Vaprobash icon indicating copy to clipboard operation
Vaprobash copied to clipboard

Apache can't connect to php5-fpm

Open benbridts opened this issue 12 years ago • 7 comments

I'm using php (latest) and apache and after provisioning I got a 500-error. This was in the apache error log:

[Fri May 09 09:13:06.149292 2014] [fastcgi:error] [pid 18537:tid 139690281211648] (13)Permission denied: [client 192.168.33.101:35036] FastCGI: failed to connect to server "/usr/lib/cgi-bin/php5-fcgi": connect() failed
[Fri May 09 09:13:06.255308 2014] [fastcgi:error] [pid 18537:tid 139690281211648] [client 192.168.33.101:35036] FastCGI: incomplete headers (0 bytes) received from server "/usr/lib/cgi-bin/php5-fcgi"

After some investigating I managed to fix it by editing /etc/php5/fpm/pool.d/www.conf , uncommenting these lines and restarting php5-fmp (service php5-fpm restart):

listen.owner = www-data
listen.group = www-data
listen.mode = 0660

This should probaby be configured in scripts/php.sh

benbridts avatar May 09 '14 10:05 benbridts

Tbis is based off of the master branch or develop branch?

Any configurations changed in your end from the defaults?

On Friday, May 9, 2014, Ben Bridts [email protected] wrote:

I'm using php (latest) and apache and after provisioning I got a 500-error. This was in the apache error log:

[Fri May 09 09:13:06.149292 2014] [fastcgi:error] pid 18537:tid 139690281211648Permission denied: [client 192.168.33.101:35036] FastCGI: failed to connect to server "/usr/lib/cgi-bin/php5-fcgi": connect() failed [Fri May 09 09:13:06.255308 2014] [fastcgi:error] [pid 18537:tid 139690281211648] [client 192.168.33.101:35036] FastCGI: incomplete headers (0 bytes) received from server "/usr/lib/cgi-bin/php5-fcgi"

After some investigating I managed to fix it by editing /etc/php5/fpm/pool.d/www.conf , uncommenting these lines and restarting php5-fmp (service php5-fpm restart):

listen.owner = www-data listen.group = www-data listen.mode = 0660

This should probaby be configured in scripts/php.sh

— Reply to this email directly or view it on GitHubhttps://github.com/fideloper/Vaprobash/issues/306 .

fideloper avatar May 09 '14 11:05 fideloper

I'm getting this too - master branch, fresh vagrant provision

Edit: Changes from op fixed my issue, chmoding the socket file didn't help

DanSmith70 avatar May 09 '14 11:05 DanSmith70

Had same issue. Master branch, provisioned from scratch. PHP changed from 5.5.11 to 5.5.12 since this issue, fixed by using:

sudo chmod 666 /var/run/php5-fpm.sock

Using nginx.

qejk avatar May 09 '14 11:05 qejk

Looks like an update to php5-fpm.

From the notes in the conf, I think uncommenting the following:

listen.owner = www-data
listen.group = www-data
listen.mode = 0660

...will be the best fix for this - Permissions set on the sock file may just get reset when fpm or the server is restarted.

fideloper avatar May 09 '14 11:05 fideloper

(thanks @bandb42!)

fideloper avatar May 09 '14 11:05 fideloper

Thank you for the quick fix, @fideloper

The rationale behind the change in php5-fpm can be found in this upstream bug.

benbridts avatar May 09 '14 13:05 benbridts

Nice, thanks for the added context. I was trying to find something like that to see if they had an explanation of changes in their docs or something.

fideloper avatar May 09 '14 14:05 fideloper