Install Nginx-PHP on Debian
Simple work with apt-get.Install Nginx, install PHP-fpm.
apt-get install git nginx php5-fpm php5-cli php5-curl php5-gd php5-mcrypt php5-mysql php5-sqlite php5-mcrypt
Edit /etc/php5/fpm/php.ini
, set
cgi.fix_pathinfo=0
Then, set the vhosts in /etc/nginx/sites-*
, and restart the services.
/etc/init.d/php5-fpm restart
/etc/init.d/nginx reload
A common sample to set a vhost for a server name to one directory on disk.
server {
listen 80;
server_name sample.com;
root /var/www/sample;
index index.html index.htm index.php;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
コメントを残す