Ubuntu 13.04 nginx PHP Installation

Source: Internet
Author: User
have been groping, Baidu a lot of articles, to arrive at the simplest installation method, but do not know whether it is correct, or what is missing.

1. Installing 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

Installation is complete, now there are two problems, many articles on the internet are similar, the main difference in PHP installation and Nginx configuration where.

1.php only need to install PHP5-FPM?

2. Location ~ \.php$ {
# Fastcgi_split_path_info ^ (. +\.php) (/.+) $;
# # Note:you should has "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 does the configuration of each line mean?

3. Why do I use Fastcgi_pass 127.0.0.1:9000 to start nginx?


Reply to discussion (solution)

No, come and have a look.

Recommend that code be posted for analysis

First of all, I built, you use Centsos? PHP, he is more than Ubuntu? You can search for CentOS's history.
sudo apt-get install Nginx
What is sudo? Limit apt-get install is direct Ubuntu? like to get Ann Bao Ann?
The command in CentOS is yum install Nginx

Build PHP on Linux? I'm building it. Lnmp??? The??? After the close of the boundary, then again? What is the quality of the nginx? and fastcgi? A part of it is very hemp and important, and there are fixed placement methods available for you to test, a lot of Yi to yourself?? Groping, because? The hardware and performance of each server is different, if it is not good, your station? Often out of??? 500 or?? 502

  • Related Article

    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.