您好,登錄后才能下訂單哦!
PHP源碼編譯
下載軟件包
從www.php.net官方網站下載PHP源碼包
##########################
soap動態
fpm 平滑加載php配置(php,)
zend加速php
##########################
[root@server79 ~]# tar jxf php-5.4.12.tar.bz2
新建nginx用戶
[root@server79 php-5.4.12]#useradd -M -d /usr/local/lnmp/nginx/ -s /sbin/nologin nginx
配置安裝環境
安裝PHP需要下面軟件包的支持,如果沒有安裝,請自行安裝。
yum install net-snmp-devel curl-devel libxml2-devel libpng-devel libjpeg-devel freetype-
devel gmp-devel openldap-devel -y
開始編譯安裝PHP:
--enable-fpm:激活對FastCGI模式的fpm支持
[root@server79 php-5.4.12]# ./configure --prefix=/usr/local/lnmp/php --with-config-file-path=/usr/local/lnmp/php/etc --with-openssl --with-snmp --with-gd --with-zlib --with-curl --with-libxml-dir --with-png-dir --with-jpeg-dir --with-freetype-dir --with-pear --with-gettext --with-gmp --enable-inline-optimization --enable-soap --enable-ftp --enable-sockets --enable-mbstring --with-mysqli=/usr/local/lnmp/mysql/bin/mysql_config --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-mcrypt=/usr/local/lnmp/modules/libmcrypt/ --with-mhash=/usr/local/lnmp/modules/mhash/
錯誤1:
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.
根據提示解決:
[root@server79 php-5.4.12]# yum install libxml2-devel -y
再次編譯,出現錯誤2:
configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
解決:
[root@server79 php-5.4.12]# yum install curl-devel
錯誤3:
configure: error: jpeglib.h not found
解決 :安裝圖形支持
yum install libpng-devel libjpeg-devel freetype-devel gmp-devel
錯誤4:
configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.
解決:
[root@server79 php-5.4.12]# yum install net-snmp-devel
[root@server79 php-5.4.12]# make ZEND_EXTRA_LIBS='-liconv'
make完之后會報錯
錯誤:
/usr/bin/ld: cannot find -liconv
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
解決:
[root@server79 php-5.4.12]# vim /etc/ld.so.conf
/usr/local/lnmp/modules/libiconv/lib
加載
[root@server79 php-5.4.12]#ldconfig /usr/local/lnmp/modules/libiconv/lib
[root@server79 php-5.4.12]# make
[root@server79 php-5.4.12]# make install
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。