2

I've inherited the sysadmin role on a server that's running a wordpress website on top of Apache 2.4/Debian. It almost works, but it is issuing "500 internal server error" from time to time. In my error.log file I see:

End of script output before headers: php5, referer: http://www.xxxxxxx.xxx/wp-admin/post-new.php

I think the server is running mod_fcgid system wide, since I have

/etc/apache2/conf-enabled/fcgid.conf 

with the following contents:

<Location />
  AddHandler fcgid-script .php
  Options +ExecCGI +FollowSymLinks
  FcgidWrapper /usr/bin/php-cgi .php
</Location>

<Files ~ (\.php)>
    AddHandler fcgid-script .php
    FCGIWrapper /usr/lib/cgi-bin/php5 .php
    Options  ExecCGI FollowSymLinks
    allow from all 
</Files>

and I've found other questions, here and here, that are about the same error I get and that cite some mod_fcgid misconfiguration as the possible cause (wrong values in PHP_FCGI_CHILDREN and PHP_FCGI_MAX_REQUESTS variables). A reply in this forum also suggests a fcgid misconfiguration and seems to give more details about the problem (a possible bottleneck in number of accepted threads/connections), but it lacks a step-by-step explanation of what to do.

I'm no mod_fcgid expert. Can you help me understand where and how I should set the correct values for PHP_FCGI_CHILDREN and PHP_FCGI_MAX_REQUESTS variables?

2
  • It's likely set in a separate vhost config file (should be under /etc/apache2/sites-enabled somewhere) or in the .htaccess file of the Wordpress installation.
    – Oldskool
    Mar 3, 2015 at 10:56
  • Actually those variables aren't currently set anywhere, if they were "grep -ri" would find them. I need to know where should I add them in order set values other than the defaults. Mar 3, 2015 at 14:33

1 Answer 1

1

You can add FCGI directive in the Apache pre_virtualhost_global.conf or the .htaccess file for the wordpress install, or in the vhost for the domain itself.

1
  • 1
    Could you please give me an example of how to set them in the vhost? Thanks Apr 24, 2015 at 16:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .