1

I have installed CakePHP 3.1 on my apache server via composer, but after that I get an 500 error. The .htaccess file looks good. "AllowOverride All" is set to All for vhosts and */htdocs. The log shows this line: [Thu Sep 24 10:15:20.193955 2015] [:error] [pid 7231:tid 2761524324096] (104)Connection reset by peer: [client 89.x.x.x:42930] FastCGI: failed to read from backend server

Since my host is Gandi, I looked up for some hints there:

This error indicates that the Apache service did not get a response from the interpreter (PHP, node.js, Python, etc.) and so it was unable to deliver the requested page. When this error occurs, you should analyze the interpreter's logs in order to search for the error that is at the origin of the problem.

So, what do I do now? the logs directory of CakePHP only shows an empty file named "empty". I hope someone can give me a hint, how I can solve the problem.

PS: While installing CakePHP, I got the following errors, which I thought I could ignore, since it proceeded with installation: Cannot create cache directory /srv/data/.composer/cache/[...] , or directory is not writable. Proceeding without cache

ndm
  • 59,784
  • 9
  • 71
  • 110
Shaun
  • 11
  • 1
  • 3
  • possible duplicate of [CakePHP chmod question](http://stackoverflow.com/questions/7179537/cakephp-chmod-question) – Lars Ebert Sep 24 '15 at 10:48
  • 1
    As the hint says, you should probably start with checking the interpreter logs, that is the [**PHP**](http://php.net/manual/en/errorfunc.configuration.php#ini.error-log) (not CakePHP) and possibly [**PHP-FPM**](http://php.net/manual/de/install.fpm.configuration.php) logs. Contact your hoster if you don't know where these logs are. – ndm Sep 24 '15 at 10:50
  • @ndm fpm.log says the following: `[24-Sep-2015 11:48:51] WARNING: [pool www] child 7661 exited on signal 7 (SIGBUS) after 97.890442 seconds from start` – Shaun Sep 24 '15 at 11:49
  • Well, I'm no Apache/PHP-FPM expert, but from the time and pid difference this hardly seems related. I'd suggest that you check this with a basic, raw PHP script to test whether CakePHP has anything to with with at all, and if that's actually not the case, then you might be better off asking for help over at [**serverfault**](http://serverfault.com/). – ndm Sep 24 '15 at 12:27
  • The time is the same for both entries, I just triggered the lines several times and didnt copy the same lines of the same time. I just tried it again, both error.log and fpm.log had a new entry in the same second. Anyway thank you, I will follow your other suggestions. – Shaun Sep 24 '15 at 12:35
  • The ps is irrelevant and just a distraction - best deleted. If CakePHP's log folder is empty, then there was basically no request according to CakePHP - something is wrong/broken before that. – AD7six Sep 24 '15 at 15:20

1 Answers1

0

The second error message indicates that your temporary directories are not writable. CakePHP tries to place some files there to cache them and this fails, as the directories could not be created.

You can make the directories writable by performing this command in the console (assuming you have access via SSH) or asking your host for assistance.

chmod -R 755 <the actual cakephp directory>
Lars Ebert
  • 3,487
  • 2
  • 24
  • 46
  • 1
    The error actually [stems from Composer](https://github.com/composer/composer/blob/3c5f3e6dc7e953ccf44d78a88044c317d6b9e04e/src/Composer/Cache.php#L50), not from CakePHP. – ndm Sep 24 '15 at 10:54
  • For that, I need to chance the rights of .composer/cache. But this directory doesnt exist. Not before nor after the installation. The rights in the phpcake directory are looking fine: http://i.imgur.com/ysJrzx4.png – Shaun Sep 24 '15 at 11:41
  • You have to change the rights of the .composer directory before the installation, so the cache directory can be created in the first place. – Lars Ebert Sep 24 '15 at 11:53
  • Sadly, I don't have the rights do create a .composer directory manually at /srv/data. Looks like a restriction from the hoster. – Shaun Sep 24 '15 at 11:57
  • The composer install notice is not related to anything you see via a http request. – AD7six Sep 24 '15 at 14:18