Nginx + PHP +mysql (suitable for thinkphp)

Source: Internet
Author: User
Tags fpm

Nginx stand-alone configuration

Http://tengine.taobao.org/book/index.html (Taobao book)

http://ubuntuhandbook.org/index.php/2013/10/install-nginx-php5-mysql-lemp-ubuntu-1310/(Nginx+php5+mysql)

http://blog.csdn.net/hursing/article/details/21527159 (English)

: Questions about several commands:

sudo apt-get install mysql-server mysql-client

sudo apt-get install Nginx
sudo apt-get install PHP5-FPM

: PHP only needs to use PHP5-FPM

: Configure your own server, directory, etc., support thinkphp, directory for/home/ftp:

Open: sudo vim/etc/nginx/sites-available/default

server {

Listen default_server;

Listen [::]:80 default_server Ipv6only=on;

Root/home/ftp;

Index index.html index.htm index.php;

server_name localhost;

Location/{

if (!-e $request _filename) {

Rewrite ^ (. *) $/index.php?s=$1 last;

Break

}

}

Location ~* \.php$ {

Fastcgi_pass Unix:/var/run/php5-fpm.sock;

Fastcgi_index index.php;

Include Fastcgi_params;

Set $path _info "";

Set $real _script_name $fastcgi _script_name;

if ($fastcgi _script_name ~ "^ (. +?\.php) (/.+) $") {

Set $real _script_name $;

Set $path _info;

}

Fastcgi_param script_filename $document _root$real_script_name;

Fastcgi_param script_name $real _script_name;

Fastcgi_param path_info $path _info;

}

Nginx + PHP +mysql (suitable for thinkphp)

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.