標籤:
搞了整整一天,好不容易折騰完,在此記錄下,下次就省事了。
去官網http://www.php.net/downloads.php下載所需要的php版本,這裡我選擇5.6.22。
下載:
wget http://cn2.php.net/distributions/php-5.6.22.tar.gz
解壓:
tar -zxvf php-5.6.22.tar.gz && cd php-5.6.22
configure指令碼:
/configure --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-gd --with-openssl --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --enable-sockets --with-apxs2=/usr/bin/apxs2 --with-mcrypt --with-curl --with-mhash --with-bz2 --enable-ftp --enable-shared --enable-shmop --enable-sysvsem --enable-bcmath --enable-fpm --enable-maintainer-zts --enable-gd-native-ttf --with-mysql=/usr --with-config-file-path=/etc/php5/apache2 --with-config-file-scan-dir=/etc/php5/conf.d --with-openssl=/usr
編譯安裝:
make && make install
期間如果遇到錯誤:
出現得錯誤如下:
錯誤一:
configure: error: xml2-config not found. Please check your libxml2 installation.
而我已經安裝過了libxml2,但是還是有這個提示:
解決辦法:
# sudo apt-get install libxml2-dev
錯誤二:
configure: error: Please reinstall the BZip2 distribution
而我也已經安裝了bzip2,網上找到得解決方案都是需要安裝bzip2-dev,可是11.10裡面沒有這個庫。
解決辦法:在網上找到bzip2-1.0.5.tar.gz,解壓,直接make ,sudo make install.(我使用的該源來自於http://ishare.iask.sina.com.cn/f/9769001.html)
錯誤三:
configure: error: Please reinstall the libcurl distribution -easy.h should be in /include/curl/
解決辦法:
# sudo apt-get install libcurl4-gnutls-dev
錯誤四:
configure: error: jpeglib.h not found.
解決辦法:
# sudo apt-get install libjpeg-dev
錯誤五:
configure: error: png.h not found.
解決辦法:
# sudo apt-get install libpng-dev
錯誤六:
configure: error: libXpm.(a|so) not found.
解決辦法:
# sudo apt-get install libxpm-dev
錯誤七:
configure: error: freetype.h not found.
解決辦法:
# sudo apt-get install libfreetype6-dev
錯誤八:
configure: error: Your t1lib distribution is not installed correctly. Please reinstall it.
解決辦法:
# sudo apt-get install libt1-dev
錯誤九:
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
解決辦法:
# sudo apt-get install libmcrypt-dev
錯誤十:
configure: error: Cannot find MySQL header files under yes.
Note that the MySQL client library is not bundled anymore!
解決辦法:
# sudo apt-get install libmysql++-dev
錯誤十一:
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
解決辦法:
# sudo apt-get install libxslt1-dev
ubuntu下編譯安裝mysql記錄