1、下载php
wget http://cn2.php.net/distributions/php-5.6.0.tar.gz
2、安装相关组件
yum install gcc gcc-c++ curl-devel bzip2 bzip2-devel openssl openssl-devel libxml2-devel libjpeg libjpeg-devel libmcrypt* libpng-devel
3、编译
./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql/ --with-apxs2=/usr/local/httpd/bin/apxs --enable-mbstring --with-gd --with-zlib --enable-sockets --enable-bcmath --enable-xml --with-bz2 --enable-zip --with-mcrypt --with-openssl --with-mysqli --with-mysql-sock --enable-gd-native-ttf --enable-pdo --with-pdo-mysql --with-gettext --with-curl --with-pdo-mysql - -enable-fpm
make
make install
4、设置php
cp php.ini-development /usr/local/php/lib/php.ini
5、是apapche支持php
vi /usr/local/httpd/conf/httpd.conf
查找字符串AddType,并增加
AddType application/x-httpd-php .php .php3 .htm .phtml .php4
AddType application/x-httpd-php-source .phps
查找字符串DirectoryIndex,并修改为
DirectoryIndex index.html index.php3 index.php default.php
6、nginx开启php支持
# ln -s /usr/local/php/etc/php.ini /etc/php.ini
# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
# vi /usr/local/php/etc/php-fpm.conf
user = www
group = www
#取消前面的分号 pid = run/php-fpm.pid
设置php-fpm开机启动
vi /etc/rc.local 加入
/usr/local/php/sbin/php-fpm
共同学习,写下你的评论
评论加载中...
作者其他优质文章