一,下载PHP依赖包
我这里是在本地源库安装的
rpm -ivh zlib-devel-1.2.7-17.el7.x86_64.rpm xz-devel-5.2.2-1.el7.x86_64.rpm libxml2-devel-2.9.1-6.el7_2.3.x86_64.rpm
解压软件包
tar -zxf zend-loader-php5.5-linux-x86_64_update1.tar.gz
配置
./configure --prefix=/usr/local/php5
–with-apxs2=/usr/local/httpd/bin/apxs
–with-mysql=/usr/local/mysql
–with-mysqli=/usr/local/mysql/bin/mysql_config
–with-config-file-path=/usr/local/php5
–enable-mbstring
出现
是因为路径错误
./configure --prefix=/usr/local/php5
–with-apxs2=/usr/local/http/bin/apxs
–with-mysql=/usr/local/mysql
–with-mysqli=/usr/local/mysql/bin/mysql_config
–with-config-file-path=/usr/local/php5
–enable-mbstring
编译安装
make && make install
优化配置整理
tar zxf zend-loader-php5.5-linux-x86_64_update1.tar.gz
进入 zend-loader-php5.5-linux-x86_64_update1
cp ZendGuardLoader.so /usr/local/php5/lib/php/
进入
vim /usr/local/php5/php.ini
添加
zend_extension=/usr/local/php5/lib/php/ZendGuardLoader.so
zend_loader.enable=1
http部署php需要在
vim /usr/local/httpd/conf/httpd.conf
添加
AddType application/x-httpd-php .php
DirectoryIndex index.php index.html