Ubuntu13.04nginxphp Assembly

Source: Internet
Author: User
Ubuntu13.04nginxphp has been exploring before installation. many articles on Baidu have come up with the simplest installation method, but I don't know whether it is correct or what is missing. 1. install nginxsudo & nbsp; apt-get & nbsp; install & nbsp; nginx2. install phps ubuntu 13.04 nginx php
I have been exploring for some time. Baidu has made many articles to come up with the simplest installation method, but I don't know whether it is correct or what is missing.

1. install nginx
Sudo apt-get install nginx

2. install php
Sudo apt-get install php5-fpm

3. Configure nginx
Sudo gedit/etc/nginx/sites-available/default

Root/www;
Index index.html index.htm index. php;

Location ~ \. Php $ {
Fastcgi_pass unix:/var/run/php5-fpm.sock;
Include fastcgi_params;
}

4. start nginx
Sudo service nginx start

After the installation is complete, there are two problems. many articles on the Internet are similar. The main difference lies in the installation of PHP and the configuration of nginx.

1. php do you only need to install php5-fpm?

2. location ~ \. Php $ {
# Fastcgi_split_path_info ^ (. + \. php) (/. +) $;
# NOTE: You shoshould have "cgi. fix_pathinfo = 0;" in php. ini
#
# With php5-cgi alone:
# Fastcgi_pass 127.0.0.1: 9000;
# With php5-fpm:
Fastcgi_pass unix:/var/run/php5-fpm.sock;
# Fastcgi_index index. php;
Include fastcgi_params;
}
What do the configurations of each row mean?

3. Why cannot I start nginx when fastcgi_pass 127.0.0.1: 9000 is used? Share:
------ Solution --------------------
First of all, I suggest you use centsos as the php server system, which is more specific than ubuntu, you can search for the history of centos.
Sudo apt-get install nginx
Sudo uses apt-get install to directly obtain the security package from the ubuntu images.
The command in centos is yum install nginx

Setting up a PHP environment on linux is very troublesome, but I have suggested the combination of lnmp, using this combination of environment security to Configure nginx's route number and some high-performance configurations of fastcgi is very troublesome and important, there is no fixed configuration method available for you to take the test. many things need to explore it on their own. because the hardware and performance of each server are different, if the configuration is poor, your website will often see 500 or 502

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.