PHP安裝
一、本文檔相關文件下載
二、php安裝
一、本文檔相關文件下載1、php下載地址: http://php.net/downloads.php
(備注: 本文檔下載的是php版本為php-5.6.11.tar.gz)
2、本測試機系統為 CentOS release 6.3 (Final)
二、php安裝1、安裝php
a、解壓壓縮文件 tar –zxf php-5.6.11.tar.gz
b、進入解壓目錄后,執行
./configure --prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql--enable-fpm --enable-xml --enable-soap --enable-mbstring --enable-sockets--with-curl --enable-zip --enable-ftp --with-gd --with-bz2--with-openssl --with-zlib --with-mhash --enable-exif --enable-sockets--enable-mbstring --enable-xml --enable-fpm --enable-soap --with-gd --with-curl--with-mcrypt=/usr/local/libmcrypt --with-imap --with-imap-ssl --with-jpeg-dir--with-png-dir --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf--enable-gd-jis-conv --with-kerberos
c、編譯安裝 make && make install
2、啟動php
a、復制php.ini文件
[root@hadoop phpsrc]# cpphp.ini-production /usr/local/php/etc/php.ini
b、啟動php-fpm
[root@hadoop etc]# cpphp-fpm.conf.default php-fpm.conf
[root@hadoop php]# ./sbin/php-fpm
c、檢查php-fpm端口
3、測試php
4、常見異常及處理
PHP編程錯誤一
checking libxml2 installdir... no
checking for xml2-configpath...
configure: error:xml2-config not found. Please check your libxml2 installation.
解決方案
yum install libxml2
yum install libxml2-devel
錯誤二
configure: error: Cannot find OpenSSL's<evp.h>
解決方案
yum install openssl-devel
錯誤三
checking for BZip2 in default path...not found
configure: error: Please reinstall theBZip2 distribution
解決方案
yum install bzip2-devel
錯誤四
checking for cURL in default path...not found
configure: error: Please reinstall thelibcurl distribution -
easy.h should be in<curl-dir>/include/curl/
解決方案
yum install libcurl libcurl-devel
錯誤五
If configure fails try--with-vpx-dir=<DIR>
configure: error: jpeglib.h not found.
解決方案
yum install libjpeg libpng freetypelibjpeg-devel libpng-devel freetype-devel
錯誤六
configure: error: utf8_mime2text() hasnew signature, but U8T_CANONICAL is missing. This should not happen. Checkconfig.log for additional information
解決方案
yum install libc-client-devel
錯誤七
configure: error: This c-client libraryis built with Kerberos support.
Add --with-kerberos to your configureline. Check config.log for details.
解決方案
把--with-kerberos加入./configure中
錯誤八
configure: error: mcrypt.h not found.Please reinstall libmcrypt.
解決方案
yum install libmcrypt 或者
下載libmcrypt包
(編譯安裝 ./configure --prefix=/usr/local/libmcrypt make && make install)
鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。
新聞熱點
疑難解答