溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

PHP -- 編譯安裝

發布時間:2020-02-24 17:32:24 來源:網絡 閱讀:609 作者:Ohimma 欄目:web開發

小Q:今天重新用最新版本搭建了lnmp架構,正好整合一下我博客的模塊;

1、編譯參數詳解和編譯參數安裝;

2、拷貝配置文件;

3、出的錯誤;

--------------------------------------------------------------------------------------------------------

1、編譯參數詳解和編譯參數安裝;

因為是源碼安裝,下載解壓就不說了,直接說重點;

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --without-pear --with-zlib --enable-pdo --with-pdo-mysql --with-mysql

--with-mysqli=/usr/bin/mysql_config

make  &&  make install

--prefix=/usr/local/php
指定 php 安裝目錄 
--with-apxs2=/usr/local/apache/bin/apxs
整合 apache,apxs功能是使用mod_so中的LoadModule指令,加載指定模塊到 apache,要求 apache 要打開SO模塊
--with-config-file-path=/usr/local/php/etc               
指定php.ini位置 
--with-MySQL=/usr/local/mysql
mysql安裝目錄,對mysql的支持 
--with-mysqli=/usr/local/mysql/bin/mysql_config            
mysqli擴展技術不僅可以調用MySQL的存儲過程、處理MySQL事務,而且還可以使訪問數據庫工作變得更加穩定。 
--enable-safe-mode   打開安全模式 
--enable-ftp   打開ftp的支持
 --enable-zip   打開對zip的支持 
--with-bz2    打開對bz2文件的支持        
--with-jpeg-dir   打開對jpeg圖片的支持 
--with-png-dir   打開對png圖片的支持 
--with-freetype-dir   打開對freetype字體庫的支持 
--without-iconv   關閉iconv函數,種字符集間的轉換 
--with-libXML-dir   打開libxml2庫的支持 
--with-XMLrpc    打開xml-rpc的c語言 
--with-zlib-dir   打開zlib庫的支持 
--with-gd    打開gd庫的支持 
--enable-gd-native-ttf   支持TrueType字符串函數庫
 --with-curl    打開curl瀏覽工具的支持 
--with-curlwrappers    運用curl工具打開url流 
--with-ttf     打開freetype1.*的支持,可以不加了
 --with-xsl     打開XSLT 文件支持,擴展了libXM2庫 ,需要libxslt軟件 
--with-gettext     打開gnu 的gettext 支持,編碼庫用到 
--with-pear    打開pear命令的支持,PHP擴展用的 
--enable-calendar    打開日歷擴展功能 
--enable-mbstring    多字節,字符串的支持 
--enable-bcmath    打開圖片大小調整,用到zabbix監控的時候用到了這個模塊 
--enable-sockets     打開 sockets 支持 
--enable-exif    圖片的元數據支持 
--enable-magic-quotes    魔術引用的支持 
--disable-rpath    關閉額外的運行庫文件
 --disable-debug    關閉調試模式 
--with-mime-magic=/usr/share/file/magic.mime      魔術頭文件位置
CGI方式安裝才用的參數
--enable-fpm                       
打上PHP-fpm 補丁后才有這個參數,CGI方式安裝的啟動程序
--enable-fastCGI                
支持fastcgi方式啟動PHP 
--enable-force-CGI-redirect        
重定向方式啟動PHP 
--with-ncurses                     
支持ncurses 屏幕繪制以及基于文本終端的圖形互動功能的動態庫
--enable-pcntl                     freeTDS需要用到的,可能是鏈接mssql 才用
mhash和mcrypt算法的擴展
--with-mcrypt                     算法 
--with-mhash                      算
以上函數庫需要安裝
--with-gmp  應該是支持一種規范 
--enable-inline-optimization  優化線程
--with-openssl                     openssl的支持,加密傳輸時用到的 
--enable-dbase                     建立DBA 作為共享模塊
--with-pcre-dir=/usr/local/bin/pcre-config      perl的正則庫案安裝位置 
--disable-dmalloc
--with-gdbm                     dba的gdbm支持 
--enable-sigchild
--enable-sysvsem
--enable-sysvshm
--enable-zend-multibyte         
支持zend的多
--with-openssl,需要openssl庫。

2、配置文件

cp php.ini-production /usr/local/php/etc/php-ini

cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

chmod 755 /etc/init.d/php-fpm

 chkconfig --add php-fpm

 chkconfig  php-fpm  on

/usr/local/php/sbin/php-fpm -t

/etc/init.d/php-fpm start

3、錯誤簡解

a.  error: wrong mysql library version or lib not found. Check config.log for more information.

    解決:將上邊標紅的編譯參數去掉,之后活動編譯該模塊 --with-mysqli=/usr/bin/mysql_config

b. ERROR: [pool www] cannot get uid for user 'php-fpm'

    解決:useradd -s /sbin/nologin php-fpm

c. /lib64/liblber-2.4.so.2: could not read symbols: Invalid operation

   解決:進入Makefile 文件,找到開頭為 EXTRA_LIBS=,在最后邊加上-llber 即可


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女