Instalare Nginx cu php5-FPM in Ubuntu 12.04 LTS

Instalarea Nginx:

apt-get install nginx

Instalarea php5-FPM:

apt-get install php5-common php5-cli php5-fpm

Pornirea Nginx:

/etc/init.d/nginx start

Enable php-FPM:

vim /etc/nginx/sites-available/default

unde trebuie sa decomentam liniile referitoare la „location ~ \.php$ {” astfel incat sa arate asa:

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}

La final restartam nginx si php-fpm ruland:

/etc/init.d/nginx restart
/etc/init.d/php5-fpm restart

Testarea se face cu un info.php sau ruland whoami din php.

In ubuntu 12.10 sau o distributie mai noua trebuie inlocuita linia: fastcgi_pass 127.0.0.1:9000; cu fastcgi_pass unix:/var/run/php5-fpm.sock;

Leave a Reply

srv StandDuPp
Articole recente