0

I would like to install a php based webapp on my server but during the install I get a »500 Internal Error«. On my search through the web I could figure out that this happens because the setup of my server uses FastCGI for PHP. The error comes to happen, because the script time out is too short and there might also be an issue with the amount of available ram for the php. So my question is:

How can I increase the timeout and probably other resources for php with FastCGI. Could /etc/apache2/mods-available/fcgid.conf be the place to go?

Additionally, in the applications .htaccess I could find these to lines, but uncommenting them gave me »404 Not Found:« /cgi-bin/php5-cgi/index.php

#    Action php5-cgi /cgi-bin/php5-cgi
#    AddHandler php5-cgi .php

Thanks in ahead!

Update

checking /var/log/apache2/error.log gave me this:

[Fri Nov 22 12:51:07 2013] [notice] mod_fcgid: call /home/xxxx/public_html/index.php with wrapper /home/xxxx/fcgi-bin/php5.fcgi
PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cgi/conf.d/mcrypt.ini on line 1 in Unknown on line 0
[Fri Nov 22 12:51:49 2013] [warn] mod_fcgid: process 377 graceful kill fail, sending SIGKILL
[Fri Nov 22 12:51:55 2013] [notice] mod_fcgid: process /home/xxxx/public_html/info.php(377) exit(communication error), get stop signal 9

What could that mean?

philipp
  • 137
  • 2
  • 10

1 Answers1

1

Those parameters are configurated in php.ini, usually located in

/etc/php5/php.ini

but may also be more specific like :

/etc/php5/apache2/php.ini

or maybe

/etc/php5/fastsgi/php.ini

To be absolutly accurate you can create a "phpinfo file", it will show you the path of actually used config file :

Create a info.php file on your server and access it from a browser

<?php
 phpinfo();
?>

The first lines should show you the used file.

The two parameters you are looking for are :

  • max_execution_time = 30 #30 seconds
  • memory_limit = 64M #64 Mo

You may have to restart Apache to take new parameters into account (I am not sure for FastCGI).

Note that you can refresh the phpinfo page to check if the new config is taken into account

Don't forget to remove the phpinfo file.

Huge
  • 231
  • 3
  • 6
  • Thanks for your reply, I followed the steps and could see higher values. But please see my update, I guess that is causing the issue? – philipp Nov 22 '13 at 11:58
  • I am not sure there is a correlation. you should `tail -f` on log files while refreshing your page, to check what shows up there when your PHP is being executed. – Huge Nov 22 '13 at 13:31