Nginx + php + mysql (applicable to thinkphp) and nginxthinkphp
Nginx single-Host 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)
: A few command issues:
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 and directory. thinkphp is supported. The directory is/home/ftp:
Open: sudo vim/etc/nginx/sites-available/default
Server {
Listen 80 default_server;
Listen [:]: 80 default_server defaults 6only = 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 $1;
Set $ path_info $2;
}
Fastcgi_param SCRIPT_FILENAME $ document_root $ real_script_name;
Fastcgi_param SCRIPT_NAME $ real_script_name;
Fastcgi_param PATH_INFO $ path_info;
}