-1

after changing the hosting provider (which at this point has no idea what is going on or the intention / interest to solve the problem it seems), we ran into an issue, where every php script ends after 30 seconds execution time resulting in an internal server error.

The script where we noticed this first, ran just fine on the old server, but I can imagine this info doesn't really help, so here are a few infos about the current server (settings).

Debian GNU/Linux amd64 6.0.7 (squeeze) PHP Version 5.3.25-1~dotdeb.0 Server API FPM/FastCGI

php.ini settings: memory_limit 256M (changed this from 128M to 512M ... back to 256M witout a difference) max_execution_time 180 (changed this from 30 to 60 ... 300 back to 180 without a difference) max_input_time 60

By "changed" I mean, we had to request the changes to be made, we can't do that on our own. The support guy also told me, that he was trying to set a few sohosin variables back and forth but that didn't help either. Also the php / apache error logs seem to give no clues, he said.

I am a bit confused about the MySQL version because, the cms we're running uses: mysql_get_server_info($this->connection); to show the version, which returns: 5.3.25-1~dotdeb.0. The credentials in the config file on the other hand, points to a server where phpmyadmin states that the software version is: 5.5.27 - MySQL Community Server (GPL)

I would highly appreciate if you just could point me in the right direction to solve this. If you need more information (like dpkg -l 'php*' | grep '^.i' or something), just let me know.

agile
  • 1
  • 2

1 Answers1

0

You need to know what is the exact PHP error to be able to solve the problem. Prepend this to a failing PHP script:

ini_set ( "display_errors", "1");

To see if you can get some details. The most likely reason for this if you changed the hosting provider is the database connection (IP, USR, PWD).

Daniel J.
  • 214
  • 1
  • 5
  • Thank you for your quick response. The display of errors is set to 1 and error reporting is set to E_ALL. The response from the server is still: Internal Server Error (html page). – agile Sep 04 '13 at 10:55
  • The first thing to do is get the error details. Activate php error logging in /etc/php.ini, look for this line -log_errors = On- and set it on or uncomment it, look for the line -display_errors=on- and uncomment it or set it to "on", prepend this line to to your script -ini_set ( "display_startup_errors", "1");-, check the output of the php error log and also see if you can see something on the screen. – Daniel J. Sep 04 '13 at 11:02
  • Ok, did that - nothing else than "Internal Server Error" gets printed to the screen. We now have an entry in the error log though: [04-Sep-2013 13:04:16 Europe/Berlin] PHP Fatal error: Maximum execution time of 180 seconds exceeded in /var/www/version6/test.php on line 4 | This is written shorty after 30 seconds – agile Sep 04 '13 at 11:09
  • Edit NGINX config and remove the custom 500 error page to let PHP show its errors and add this to the head of the script: – Daniel J. Sep 04 '13 at 11:10
  • ini_set ( "display_errors", "1"); ini_set ( "display_startup_errors", "1"); ini_set ( "html_errors", "1"); ini_set ( "docref_root", "http://www.php.net/"); ini_set( "memory_limit", "512M" ); ini_set( "max_execution_time", "30" ); – Daniel J. Sep 04 '13 at 11:12
  • In any case if you have it in every page I bet its the connection to the database that's failing – Daniel J. Sep 04 '13 at 11:16
  • The connection to the database seems ok, since the cms works "fine". The script which made us notice that something on the new server doesn't seem right, was an csv file (import task). That said, any other script that runs more than 30 seconds will be terminated. On SO I found this snippet to test for an execution timeout: while (true) { sha1(time()); } ... to which I added the ini directives of yours. The error log (php_error.log) now shows an "Maximum execution time of NN seconds exceeded" (if set to 60 it's 60 if set to 180 NN is 180). phpinfo() shows the "correct" value. – agile Sep 04 '13 at 11:27
  • Check taht all the dependencies for your application are installed in the operating system – Daniel J. Sep 04 '13 at 12:00
  • ... apaches idle-timeout setting. I'd like to thank you for your time and patience. – agile Sep 04 '13 at 13:37