編譯安裝php5.6.30報錯
阿新 • • 發佈:2017-12-28
linux php
[root@wuhan_id01_u4_19.116 Software]# cat /etc/redhat-release
CentOS release 6.8 (Final)
...
編譯報錯:make: *** [sapi/cli/php] Error 1
分析
在編譯安裝php時出現 [undefined reference to libiconv_open']子類的錯誤信息,表示在 ./configure 沒抓好些環境變數值,錯誤發生點在建立 [ -o sapi/cli/php], 沒給到要 link的iconv 函數庫參數。解決
編輯Makefile 文件中:EXTRA_LIBS = ..... -lcrypt 在最後加上 -liconv,例如: EXTRA_LIBS = ..... -lcrypt -liconv 然後重新再次 make 即可。擴展
php 安裝之後沒有php-fpm相關的文件,這是編譯參數少了--enable-fpm編譯參數
./configure \
--prefix=/usr/local/Software/php5.6.30 \
--with-mysql=/usr/local/Software/mysql \
--with-apxs2=/usr/local/Software/apache2/bin/apxs \
--with-iconv-dir=/usr/local/libiconv \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr\
--enable-xml \
--disable-rpath \
--enable-safe-mode \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--with-curlwrappers \
--enable-mbregex \
--enable-fpm \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--enable-short-tags \
--enable-zend-multibyte \
--enable-static \
--with-xsl \
--with-fpm-user=www \
--with-fpm-group=www\
--enable-ftp \
您覺得有幫助,點贊唄 :)
編譯安裝php5.6.30報錯