Yum installs Nginx and PHP-FPM

Source: Internet
Author: User

PHP php-fpm Nginx
Installing the Yum source Remi
RPM-UVH http://mirrors.opencas.cn/epel/6/x86_64/epel-release-6-8.noarch.rpm
RPM-IVH http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Installing the Software
One. PHP php-fpm
Packages that use the Remi Source
Yum--enablerepo=remi Install PHP php-fpm
Two. Installing Nginx
Install Nginx Source (CENTOS6 system to install http://nginx.org/packages/centos/5/x86_64/RPMS/nginx-1.8.0-1.el5.ngx.x86_64.rpm directly below)
RPM-IVH http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
Yum Install Nginx
Three. Configuration
Vi/etc/nginx/nginx.conf

Modify
Location ~ \.php$ {
root/usr/share/nginx/html; #修改为网站路径
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Fastcgi_param script_filename $document _root$fastcgi_script_name; #document_root指的是上面的root, use PHP-FPM parsing for php files under this path
Include Fastcgi_params;
}
Three. Start Php-fpm,nginx
/etc/init.d/nginx start
/ETC/INIT.D/PHP-FPM start

If you modify the configuration file, use/etc/init.d/nginx reload to load

Four. Testing

Under the Nginx path

Cd/usr/share/nginx/html

VI index.php

    1. <?php

    2. Phpinfo ();

    3. ?>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6E/A4/wKiom1WBPSHDWu2eAAMZ_8d5xBY185.jpg "title=" Php.png "alt=" Wkiom1wbpshdwu2eaamz_8d5xby185.jpg "/>

Yum installs Nginx and PHP-FPM

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.