1.安裝php所有的依賴軟體包
[root@web01 ~]# yum install zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel openssl-devel -y檢查是否安裝成功
[root@web01 ~]# rpm -qa zlib-devel libxml2-devel libjpeg-turbo-devel freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel openssl-devel安裝yum無法安裝的libiconv庫[root@web01 tools]# tar zxf libiconv-1.14.tar.gz
[root@web01 tools]# cd libiconv-1.14
[root@web01 libiconv-1.14]# ./configure --prefix=/usr/local/libiconv
[root@web01 libiconv-1.14]# make && make install
新增阿里的epel.repo源(
yum源無法安裝的支援庫)libmcrypt-devel mhash mhash-devel mcrypt
wget -o /etc/yum.repos.d/epel.repo
yum -y install libmcrypt libmcrypt-devel mhash mhash-devel mcrypt
2. 編譯安裝php (php-5.5.32.tar.gz)
[root@web01 tools]# rz3. 已安裝玩mysql的情況下編譯引數:[root@web01 tools]# rz -y
[root@web01 tools]# tar xf php-5.5.32.tar.gz
[root@web01 tools]# cd php-5.5.32
[root@web01 php-5.3.32]#4.編譯php軟體過程[root@web01 php-5.5.32]# touch ext/phar/phar.phar./configure \
--enable-opcache=no
--enable-ftp
[root@web01 php-5.5.32]# make #出現bulit complete.
5.安裝php生成檔案到系統
[root@web01 php-5.5.32]# make install #installing pdo headers:6.配置php引擎配置檔案php.ini[root@web01 php-5.5.32]# ls php.ini*
php.ini-development php.ini-production #分別用於測試環境和生產環境
7.配置php服務(fastcgi方式)的配置檔案php-fpm.conf
[root@web01 etc]# ls
pear.conf php-fpm.conf.default
[root@web01 etc]# cp php-fpm.conf.default php-fpm.conf #php-fpm.conf後續會有優化
8. 啟動php服務(fastcgi方式)
[root@web01 etc]# ps -ef|grep php-fpm
nginx 13441 13440 0 18:39 ? 00:00:00 php-fpm: pool www
nginx 13442 13440 0 18:39 ? 00:00:00 php-fpm: pool www
root 13451 1724 0 18:40 pts/1 00:00:00 grep php-fpm
[root@web01 etc]# lsof -i:9000
command pid user fd type device size/off node name
php-fpm 13440 root 7u ipv4 184892 0t0 tcp localhost:cslistener (listen)
php-fpm 13441 nginx 0u ipv4 184892 0t0 tcp localhost:cslistener (listen)
php-fpm 13442 nginx 0u ipv4 184892 0t0 tcp localhost:cslistener (listen)
PHP編譯安裝
錯誤1configure error xml2 config not found.please check your libxml2 installation.解決方案 yum install y libxml2 devel錯誤2 configure error cannot find openss...
編譯安裝PHP
2 確保安裝之前有安裝gd,png,curl,xml等等lib開發庫。如果不確定,執行以下命令 yum install gcc make gd devel libjpeg devel libpng devel libxml2 devel bzip2 devel libcurl devel y 3 編...
編譯安裝PHP
編譯安裝php 安裝依賴 yum install gcc bison bison devel zlib devel libmcrypt devel mcrypt mhash devel openssl devel libxml2 devel libcurl devel bzip2 devel rea...