Nginx + php + mysql configuration in ubuntu

Source: Internet
Author: User
Welcome to the Linux community forum, interact with 2 million technical staff into 6, start fast_cgi process 1, sudousrbinspawn-fcgi-a127.0.0.1-p9000-C5-uwww-data-gwww-data-fusrbinphp5-cgi-Pvarrunfastcgi-php.pid7, set the boot to start fastcgi process and start sudo

Welcome to the Linux community forum, interaction with 2 million technical staff> 6. Start fast_cgi process 1, sudo/usr/bin/spawn-fcgi-a 127.0.0.1-p 9000-C 5-u www-data- g www-data-f/usr/bin/php5-cgi-P/var/run/fastcgi-php.pid 7. Set boot to start fastcgi process and start sudo

Welcome to the Linux community forum and interact with 2 million technicians>

6. Start the fast_cgi process.

1, sudo/usr/bin/spawn-fcgi-a 127.0.0.1-p 9000-C 5-u www-data-g www-data-f/usr/bin/php5-cgi-P // var/run/fastcgi-php.pid

7. Set boot to start fastcgi process and start

Sudo vi/etc/rc. local

Add next line

/Usr/bin/spawn-fcgi-a 127.0.0.1-p 9000-C 5-u www-data-g www-data-f/usr/bin/php5-cgi-P/var/ run/fastcgi-php.pid

If No input file specified is displayed when you open the php file, check the php. ini configuration.

Cgi. fix_pathinfo = 1

Doc_root =

In addition, you must set different directories for each Virtual Machine Based on its own virtual machine to ensure that the path is correct.

Check the configuration file in/etc/nginx/sites-available. The server contains the root and root address, not the root address in the location.

Start

Fast-cgisudo/usr/bin/spawn-fcgi-a 127.0.0.1-p 9000-C 5-u www-data-g www-data-f/usr/bin/php5-cgi-P // var/run/fastcgi-php.pid

The parameter description is as follows:

*-F specifies the location of the execution program of the process that calls FastCGI, Which is set according to the PHP installed on the system

*-A is bound to the addr address.

*-P bind to the port

*-S is the path to bind to the unix socket

*-C indicates the number of FastCGI processes generated. The default value is 5 (for PHP only)

*-P specifies the PID file path of the Generated Process

* What identity does-u and-g FastCGI use (-u user-g user group) to run? www-data can be used in Ubuntu, and others can be configured as needed, for example, nobody, apache, etc. Now you can test a probe or PHP file in the web root directory.

8. Install mysql

Sudo apt-get install mysql-server mysql-client

In the middle, you will be prompted to enter the Root user password and enter it in sequence.

Start MySQL

Sudo/etc/init. d/mysql start

Test whether the mysql service is normal:

Run

Mysql-uroot-p

Enter the mysql password

Show databases;

If you see the following content

| Database |

| Information_schema |

| Mysql |

Mysql is correctly installed.

So far, nginx + php + mysql installation in ubuntu is complete.

[1] [2]

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.