Install NGINX+MYSQL+PHP5-FPM on ubuntu (php5-fastcgi Process Manager)

Source: Internet
Author: User
Tags fpm

Digression: Because of the near time test environment SSH link quality is not good, often short-term. Therefore, the entire installation process is placed in screen to prevent disconnection from interrupting the installation process. Execute the Screen-s install, so that after the disconnection, you can restore the previous installation interface as soon as the Screen-r install is executed.

1. Install MySQL

sudo apt-get install mysql-server mysql-client
The password for the MySQL root user will be set during installation.

2. Installing Nginx

sudo apt-get install Nginx

3. After the installation is successful. We re-start the Nginx service

sudo service nginx restart
We'll have access to our address after the launch. See if there is an nginx welcome screen.

4. Install php5-fpm (php5-fastcgi Process Manager).

sudo apt-get install PHP5-FPM

5. Next we will modify the Nginx site configuration.

The Ngnix configuration file is stored in the/etc/nginx/sites-available/default

server {
Listen 80; # # Listen for IPv4; This is default and implied
Listen [::]:80 default Ipv6only=on; # # Listen for IPv6
root/usr/share/nginx/www;
Index index.php index.html index.htm;
# make site accessible from http://localhost/
server_name _;
Location/{
# First attempt to serve request as file, then
# as Directory, then fall back to index.html
Try_files $uri $uri//index.html;
}
Location/doc {
Root/usr/share;
AutoIndex on;
Allow 127.0.0.1;
Deny all;
}
#error_page 404/404.html;
# REDIRECT Server error pages to the static page/50x.html
#
Error_page 502 503 504/50x.html;
Location =/50x.html {
root/usr/share/nginx/www;
}
# Proxy The PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# Proxy_pass http://127.0.0.1;
#}
# Pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
Location ~ \.php$ {
Try_files $uri = 404;
#fastcgi_pass 127.0.0.1:9000;
Fastcgi_pass Unix:/var/run/php5-fpm.sock;
Fastcgi_index index.php;
Include Fastcgi_params;
}
# Deny access to. htaccess files, if Apache ' s document Root
# concurs with Nginx ' s one
#
Location ~/\.ht {
Deny all;
}
}
Added some code for PHP parsing inside.

6. We are installing some components related to PHP5.

sudo apt-cache search php5
Apt-get Install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-min G Php5-ps Php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
7. Restart the service

sudo service php5-fpm restart
sudo service Nginx
8. Write a probe file and try it. Oh.

Install nginx+mysql+php5-fpm (php5-fastcgi Process Manager) on Ubuntu

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.