Problem configuring php-fpm with nginx
- by Nisanio
First of all: I'm not an expert in configuring things. This is very new for me, so, my apologies in advance.
At work we have a Centos server. The guy who worked here before installed nginx. We need to made a php site, so, obviously, I need to set up php and make it work with nginx.
Making short a very long tale, I had to replace the nginx binary with a new one (because the older was compile without fast-cgi), and I had to recompile and install php (because the new version has fpm). Then I struggle with the config files, making this nginx.conf (not all the file)
user php;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
and uncomment some parameters in php-fpm (to much to detail here, but the important is that group and user are "php")
I never could start the php-fpm with the instructions of the book
sudo /usr/sbin/php-fpm start
But after look at the net, I found this
sudo /usr/local/sbin/php-fpm --fpm-config=/usr/local/etc/php-fpm.conf
This worked (I think)
I restarted nginx. But... nothings happens with php... My calls to php files (via firefox)
doesn't even appear in the log (/opt/nginx/logs/error.log)
I'm really, really exhausted and lost... Could anyone help me, pleaaase.... :(
Thanks in advance