安装PHP:

依赖包安装:
yum install -y gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel

获取PHP的安装介质:
http://php.net/get/php-7.0.9.tar.gz/from/a/mirror

上传PHP介质到服务器,并解压:

编译:configure

安装:make

安装:make install

配置PHP:

如果没有将“etc/php-fpm.d/”下的:www.conf.default,修改为:www.conf。
则在启动php-fpm服务的时候会报错:

启动php-fpm:

关于Nginx:
参考:

Nginx:源码包安装 on RHEL6

启动Nginx:

Nginx配置文件:

样例文件(普通):

测试:

样例文件(PHP):

测试:
http://【ip】/php_me.php
php_nginx_1
可以看到,并没有被解释为PHP。

修改Nginx配置文件,并重新加载服务:

再次查看:http://【ip】/php_me.php
php_nginx_2

就没问题了。
——————————————————————
Done。

1 thought on “PHP:Install on RHEL6 with Nginx”

  1. PHP – Configure编译:./configure –prefix=/usr/local/php-7.0.9 –with-config-file-path=/usr/local/php-7.0.9/etc –with-bz2 –with-curl –enable-ftp –enable-sockets –disable-ipv6 –with-gd –with-jpeg-dir=/usr/local –with-png-dir=/usr/local –with-freetype-dir=/usr/local –enable-gd-native-ttf –with-iconv-dir=/usr/local –enable-mbstring –enable-calendar –with-gettext –with-libxml-dir=/usr/local –with-zlib –with-pdo-mysql=mysqlnd –with-mysqli=mysqlnd –enable-mysqlnd –enable-dom –enable-xml –enable-fpm –with-libdir=lib64 –enable-bcmath——————————————

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

隐藏
变装