Closed linusjf closed 3 years ago
Nginx by itself can't execute PHP scripts. It is a web server and reverse proxy.
You need to setup a fastcgi server and configure nginx to forward requests to it.
Ok. My mistake. My first trial with Nginx and CGI.
This worked for me. ~ $ php-cgi -b 127.0.0.1:9000 &
There were a couple of issues why it was not working with php-fpm. I was executing nginx and php-fpm using sudo service nginx start
and sudo service php-fpm start
which is basically a no-op operation. Secondly, the second virtual configuration in the nginx.conf falls over and nginx does not start.
Problem description I am unable to get Nginx to work with PHP files. The server is loading html pages but not PHP scripts.
Steps to reproduce
nginx.conf
www.conf
Switching the listen value to
has no effect either.
Expected behavior
Nginx must interpret and serve PHP scripts.
Additional information