[solved]cannot run PHP scripts on LEMP stackscript

[solved]

5 Replies

That error message means that the PHP-FPM process is not running. What happens when you type

/etc/init.d/php-fpm start

@hybinet:

That error message means that the PHP-FPM process is not running. What happens when you type

/etc/init.d/php-fpm start


the php page is still not running, it was redirected to nginx's 50x.html

Problem solved! Here's how:

go to /usr/local/etc/php-fpm.conf, find this line

listen = /usr/local/var/run/php-fpm.sock

comment it, and add this line after it

listen = 127.0.0.1:9000

However, I'm still not sure why this line is the cause of all the problems. Does anyone know why?

Yep, it's because listen = /usr/local/var/run/php-fpm.sock is a unix socket and you had nginx trying to pass via tcp fastcgi_pass 127.0.0.1:9000;

If you want to use the unix socket (I do they tend to be a little bit faster) set fastcgi_pass to unix:/usr/local/var/run/php-fpm.sock

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct