Not able to execute php files after fresh nginx (LEMP) installation
December 11, 2011 08:25AM
I have successfully installed(locally) Nginx PHP-FPM And MySQL Support On Ubuntu 11.10. For test I placed a phpinfo.php file in /usr/share/nginx/www/ & tried to access phpinfo.php using my browser http://localhost/phpinfo.php but nothing is happening and its showing

> The page you are looking for is temporarily unavailable. Please try
> again later.

So I checked error log file and I got this

2011/12/11 05:05:56 [error] 11164#0: *12 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /phpinfo.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"

Can anyone tell me what is wrong
Any help would be greatly appreciated
Re: Not able to execute php files after fresh nginx (LEMP) installation
December 11, 2011 09:44AM
Update I have found the answer

I edited this file /etc/php5/fpm/pool.d/www.conf n made PHP-FPM Use A Unix Socket to reduce TCP Overhead as shown below

[...]
;listen = 127.0.0.1:9000
listen = /tmp/php5-fpm.sock
[...]

But I forgot to change in this file /etc/nginx/sites-available/default.config

So I replaced fastcgi_pass 127.0.0.1:9000; to fastcgi_pass unix:/tmp/php5-fpm.sock;, e.g. like this:

[...]
location ~ \.php$ {
fastcgi_pass unix:/tmp/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
[...]
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 192
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready