CentOS   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了CentOS6.8 x86_64bit安装PHP-5.3.27大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_675_1@

概述

php-fastCGI安装 1.提前安装数据库MySQL与Web服务,确定MySQL与Web服务是否安装 ss -lntup|egrep "3306|80" 2.安装php基础依赖包,安装前修改epel源 wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo yum install -y zlib

PHP-fastCGI安装

1.提前安装数据库MysqL与Web服务,确定MysqL与Web服务是否安装
ss -lntup|egrep "3306|80"

2.安装PHP基础依赖包,安装前修改epel源
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
yum install -y zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel
yum install -y freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel
yum install -y libmcrypt-devel mhash mcrypt

3.提前下载好编译安装的软件包到指定的目录,先安装PHP依赖库libiconv
cd /home/rich/tools
rz -y libiconv-1.15.tar.gz
tar zxf libiconv-1.15.tar.gz
cd libiconv-1.15
./configure --prefix=/usr/local/libiconv@H_438_19@make && make install

4.提前下载好PHP编译安装包到指定目录下并上传到服务器上
rz -y PHP-5.3.27.tar.gz

5.解压软件包并进入到解压的目录下
tar zxf PHP-5.3.27.tar.gz
cd PHP-5.3.27

6.开始编译@L_232_14@mAKEFILE文件
./configure --prefix=/application/PHP5.3.27 \
--with-MysqL=/application/MysqL \
--with-pdo-MysqL=MysqLnd \
--with-iconv-dir=/usr/local/libiconv \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-fpm \
--enable-mbString \
--with-mcrypt
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-soap \
--enable-short-tags \
--enable-static \
--with-xsl \
--with-fpm-user=Nginx \
--with-fpm-group=Nginx \
--enable-ftp \

7.为了避免安装是出现缺少MysqL相关库文件,先提前创建MysqL的库文件软件链接到系统库下
ln -s /application/MysqL/lib/libMysqLclient.so.18 /usr/lib/

8.进入到解压包目录下开始编译安装
cd /home/rich/tools/PHP-5.3.27
touch ext/phar/phar.phar //有时会报错缺少phar.phar文件,所以先提前创建@H_438_19@make && make install

9.安装完毕后创建安装目录的软链接
ln -s /application/PHP5.3.27/ /application/PHP

10.修改部分配置文件便使用
cp PHP.ini-production /application/PHP/lib/PHP.ini
cd /application/PHP/etc
cp PHP-fpm.conf.default PHP-fpm.conf

11.启动PHP
/application/PHP/sbin/PHP-fpm
netstat -lntup|grep 9000

12.调整Web服务Nginx支持PHP
cd /application/Nginx/conf
vim Nginx.conf
... ...
LOCATIOn ~ .*.(PHP|PHP5)?$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.PHP;
include fastcgi.conf;
}
... ...

13.创建Web服务测试PHP的index文件
cd /application/Nginx/html
echo "<?PHP PHPinfo(); ?>" >test_info.PHP

14.检查Nginx语法并重启服务
/application/Nginx/sbin/Nginx -t
/application/Nginx/sbin/Nginx -s reload

15.windows浏览器输入服务器的IP地址加测试PHP的index文件,测试Web服务是否成功支持PHP
http://192.168.23.249/test_info.php

大佬总结

以上是大佬教程为你收集整理的CentOS6.8 x86_64bit安装PHP-5.3.27全部内容,希望文章能够帮你解决CentOS6.8 x86_64bit安装PHP-5.3.27所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。