ubuntu15.10 Simple Construction Nginx+php+mysql

Source: Internet
Author: User

Here is just from scratch to build a most basic environment, can let Nginx server run PHP program can, Advanced Configuration I will fill up later. Nginx Automatic Installation:sudo apt-get install nginxStart:Sudo/etc/init.d/nginx StartStop it:Service Nginx StopAccess: Browser access to localhost, successful description of Nginx installation no problem: Install PHP and MySQL:sudo apt-get install php5-cli php5-cgi mysql-server php5-mysqlInstall spawn-fcgi:sudo apt-get install spawn-fcgiStart spawn-fcgi:spawn-fcgi-a 127.0.0.1-p 9000-c 10-u www-data-f/usr/bin/php-cgiTo modify the Nginx configuration file:/etc/nginx/nginx.confTo find the appropriate configuration file, such as/etc/nginx/sites-enabled/defaultFind Index index.html index.htmindex.phpindex.nginx-debian.html;
Location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # with php5-cgi alone:
Fastcgi_pass 127.0.0.1:9000;
# with PHP5-FPM:
# Fastcgi_pass Unix:/var/run/php5-fpm.sock;
}
Add PHP-related content, modifiedre-start Nginx;Sudo/etc/init.d/nginx RestartIn the Nginx configuration file root corresponding to the path, add index.php, through localhost/index.php access, can be accessed normally
<? PHP Phpinfo ();
index.php

Effect:

ubuntu15.10 Simple Construction Nginx+php+mysql

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.