Wordpress + Virtualmin script run mode = weird issue

I’ve got really weird issue and don’t know who to address it to - Wordpress or Virtualmin?
When server script mode is in “FCGId (run as virtual server owner)” WP works ok, when it is in CGI mode it shows no posts (“no posts found” in admin panel of WP, but it shows the number of posts though), when I turn server back in to FCGid mode - it works fine again. In proper CGI mode website is also gets very slow!

The reason I turn it in to proper CGI is to get rid of these errors in error_log:
[warn] mod_fcgid: read data timeout in 31 seconds
[error] [client xx.xx.xx.xxx] Premature end of script headers: wp-cron.php
[warn] (103)Software caused connection abort: mod_fcgid: ap_pass_brigade failed in handle_request function

what’s the best advice here? from what i’ve read here people say proper CGI is the best mode for server and then go from there and dig deeper (tune in scripts, engine-wordpress in this case, upgrade server hardware, etc.) Any advice?
I just want the website to be quick (it is a small company, not much traffic), with no throwing errors or other strange things happening to WP.

System:
Virtualmin GPL
Latest WP version

Howdy,

Hmm, that’s pretty unusual… FCGID and CGI both work in a similar manner, I’m surprised you’re seeing problems.

I’ll offer that WordPress is known to be able to work in both modes on a Virtualmin system.

Are you by chance using any non-default WordPress modules? I wonder if it’s just one component that’s not working.

As far as that FCGID error you’re getting – that looks like the cron job is taking longer than 30 seconds to run, so it’s timing out.

You could always go into Server Configuration -> Website Options, and increase the value for the setting “Maximum PHP script run time”. That may resolve the issue you’re seeing.

-Eric

thanks, yes a have some non-core modules (not many), but very much doubt that it could cause posts not to show (only the number)

Which Linux distribution/version are you using?

And what PHP version do you have? You can determine that by running “php -v”.

Thanks,

-Eric

it is PHP 5.2.16 (cli) (built: Dec 17 2010)
Zend Engine v2.2.0

And which Linux distribution/version is that on? :slight_smile:

Thanks!

-Eric

sorry,
CentOS Linux 5.6
Kernel and CPU Linux 2.6.18-238.12.1.el5 on i686
Webmin version 1.561
Virtualmin version 3.87.gpl GPL

Howdy,

Okay, so, one possibility is that you’re seeing a bug of some sort. PHP 5.2.17 is available in the Virtualmin bleed repository. A lot of folks use that PHP version along with WordPress, and the FCGID, CGI, and mod_php modes are all known to work.

Another thing you might try (perhaps before changing your PHP version) is to edit $HOME/etc/php.ini for this particular domain, and set cgi.fix_pathinfo to “0” with a line like this:

cgi.fix_pathinfo=0

Some folks have found that to help issues that they run across when using PHP in the CGI or FCGID modes.

-Eric

wow, this seem to fix the problem! (adding cgi.fix_pathinfo=0)
thanks andreychek, you must have massive brain to remember all these details!