1. 程式人生 > >linux原始碼安裝PHP7.0問題彙總

linux原始碼安裝PHP7.0問題彙總

前置:libxml2, libxml2-devel, openssl-devel, curl-devel, libjpeg, libjpeg-devel, libpng, libpng-devel, freetype, freetype-devel, libxslt-devel

步驟:
1. 下載原始碼解壓.
2. ./configure 引數(安裝目錄, 各種擴充套件開啟引數, APACHE所需的PHP模組編譯).
3.根據報錯安裝所需的開發包.
4. make && make install.
5. 建立php.ini, php-fpm.conf配置檔案, 注意建立的位置.
6. php加入環境變數.
7. 找到php-fpm啟動檔案的位置, 啟動php-fpm.

問題一:
./configure ...... --with-curl ...... 出現問題--

checking for cURL support... yes

checking for cURL in default path... not found

which: no dpkg-architecture in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/wei/bin)

./configure: line 23538: curl-dir: No such file or directory

checking for cURL 7.10.5 or greater... ./configure: line 23553: curl-config: command not found

configure: error: cURL version 7.10.5 or later is required to compile php with cURL support

解決:
思路:缺失哪樣裝哪樣.一般都是 軟體包名-devel 結尾,指的是此軟體包開發工具.
參考:http://blog.sina.com.cn/s/blog_75a07c3b0101kcwb.html





問題二:
用之前安裝過一次的PHP原始碼重新安裝PHP時,./configure這一步很順利,到make 這一步時報錯:
c:204: undefined reference to `executor_globals'

解決:
經過網上查詢,在make之前需要先make clean, 原因可能是這原始碼曾經用過一次,留了一些上次安裝的資訊,與此次安裝資訊不符,make clean可能是清理這些資訊的。




問題三:
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution

解決:
雖然提示的是像是版本問題,實際上還是因為缺少此開發工具,只要安裝 libxslt-devel 即可解決。

 

配置

./configure --prefix=/usr/local/php \

 --with-curl \

 --with-freetype-dir \

 --with-gd \

 --with-gettext \

 --with-iconv-dir \

 --with-kerberos \

 --with-libdir=lib64 \

 --with-libxml-dir \

 --with-mysqli \

 --with-openssl \

 --with-pcre-regex \

 --with-pdo-mysql \

 --with-pdo-sqlite \

 --with-pear \

 --with-png-dir \

 --with-xmlrpc \

 --with-xsl \

 --with-zlib \

 --enable-fpm \

 --enable-bcmath \

 --enable-libxml \

 --enable-inline-optimization \

 --enable-gd-native-ttf \

 --enable-mbregex \

 --enable-mbstring \

 --enable-opcache \

 --enable-pcntl \

 --enable-shmop \

 --enable-soap \

 --enable-sockets \

 --enable-sysvsem \

 --enable-xml \

 --enable-zip \

  --with-apxs2=/usr/local/apache2/bin/apxs