Ubuntu12.04 configure nginxmysqlphp5 using tung.pdf
1. apt-get install mysql-server mysql-client // install the database
2. apt-get install nginx // install nginx
Gedit/etc/nginx/sites-enabled/default // nginx configuration file
Server {
Root/home/angelmylove/download/zendphp/; // address for storing the php file, which is equivalent to the documentRoot of apache
Index index.html index.htm index. php;
# Make site accessible from http: // localhost/
Server_name localhost;
Autoindex on; // An error occurred every time I did not write this sentence.
Location ~ /. Php $ {
# Fastcgi_split_path_info ^ (. +/. php) (/. +) $;
# NOTE: You shoshould have "cgi. fix_pathinfo = 0;" in php. ini
#
# With php5-cgi alone:
Fastcgi_pass 127.0.0.1: 9000;
# With php5-fpm:
# Fastcgi_pass unix:/var/run/php5-fpm.sock;
Fastcgi_index index. php;
Include fastcgi_params;
}
}
3. // install useful modules
Apt-get install php5-fpm php5-mysql php5-curl php5-gd php5-intl php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode
4./etc/init. d/nginx stop
/Etc/init. d/nginx start
5, serviec php5-fpm reload // execute every time you load a new module