CentOS 6.6 nginx PHP Configuration

Source: Internet
Author: User

/************************************************************************* * CentOS 6.6 nginx PHP Configuration * Description: * Install nginx PHP configuration on VPS for some time boring use. * 2016-11-26 Shenzhen Nanshan Ping Shan village Zengjianfeng ********************************************************* ***************/First, reference documents:1. Centos6.5Yum installation configuration Lnmp server (nginx+php+MySQL) http://blog.csdn.net/lane_l/article/details/20235909    2. php-FPM does not automatically start after reboot http://Serverfault.com/questions/459728/php-fpm-does-not-automatically-start-after-reboot    3. OpenBSD.Nginx.MySQL.PHP Environment Building Manual http://www.360doc.com/content/10/1211/11/4330887_77027995.shtmlii. Installation: Yum install php yum install php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath Php-mhash Libmcrypt Libmcrypt-devel php-FPM III, test PHP-cgi:php-cgi-b127.0.0.1:9000Four, the background to run PHP-CGI:1. /etc/rc.d/init.d/php-fpm Start2. Chkconfig php-fpm on Five, nginx configuration: [[email protected]/]# cat/etc/nginx/conf.d/php.conf server {Listen8080;        server_name localhost; #charset Koi8-R; #access_log/var/log/nginx/log/Host.access.log Main; Location/{root/home/zengjf/www;        Index index.php index.html index.htm; } #error_page404/404. html; # REDIRECT Server error pages to theStaticPage/50x.html # Error_page - 502 503 504/50x.html; Location= /50x.html {root/usr/share/nginx/html; } # Proxy The PHP scripts to Apache listening on127.0.0.1: the# #location~\.php$ {# Proxy_pass http://127.0.0.1;#} # Pass the PHP scripts to FastCGI server listening on127.0.0.1:9000# Location~\.php$ {root/home/zengjf/www; Fastcgi_pass127.0.0.1:9000;            Fastcgi_index index.php; Fastcgi_param script_filename $document _root/$fastcgi _script_name;        Include Fastcgi_params; } # Deny access to. htaccess files,ifApache's Document Root# concurs with Nginx'S One# #location~ /\.ht {# deny all; #}} [[email protected]/]#

CentOS 6.6 nginx PHP Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.