500 Internal Server Error after a week

I just moved my WP blog from shared hosting to my VPS, file: 2.6 G, database: 23 tables,177,060 row, size: 90.4 MiB. I use CentOS Linux 5.7. This my first experience use VPS.
The site run well in VPS for a week, but yesterday I got the error message: 500 Internal Server Error. I never made a new post or add a new plugin in this period.

I have done as below and still get 500 Internal Server Error

  1. I have refresh with F5 and have changed my .htaccess to be htaccess.txt

  2. In Virtualmin, I have changed:

  • I created a new account plan with quota 4GB and edit virtual server. I changed Total Server Quota and Server Administrator’s Quota to be Unlimited.

  • I changed memory_limit in PHP (Service-Configure Website) to be 1024M

  • In PHP 5 Configuration, I have changed :

    • MySQL connection timeout? to be 1000 seconds
    • Maximum memory allocation to be 500M
    • Maximum file upload size to be 50M
    • Maximum input parsing time to be 60 seconds
  • In Website Options:

    • PHP script execution mode: FCGId (run as virtual server owner)
    • Maximum PHP script run time, I changed to be Unlimited
  • Apache error log

[Sat Jan 21 13:36:08 2012] [warn] mod_fcgid: read data timeout in 31 seconds

[Sat Jan 21 13:36:08 2012] [error] [client 157.55.17.145] Premature end of script headers: index.php

[Sat Jan 21 13:36:19 2012] [warn] mod_fcgid: read data timeout in 31 seconds

[Sat Jan 21 13:36:19 2012] [error] [client 220.181.94.227] Premature end of script headers: index.php

[Sat Jan 21 13:36:21 2012] [warn] mod_fcgid: read data timeout in 31 seconds

[Sat Jan 21 13:36:21 2012] [error] [client 157.55.18.23] Premature end of script headers: index.php

[Sat Jan 21 13:36:38 2012] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.

[Sat Jan 21 13:36:38 2012] [error] [client 66.249.72.38] Premature end of script headers: index.php

[Sat Jan 21 13:36:38 2012] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.

[Sat Jan 21 13:36:38 2012] [error] [client 66.249.72.38] Premature end of script headers: index.php

[Sat Jan 21 13:38:01 2012] [warn] mod_fcgid: read data timeout in 31 seconds

[Sat Jan 21 13:38:01 2012] [error] [client 207.46.204.188] Premature end of script headers: index.php

[Sat Jan 21 13:39:02 2012] [warn] mod_fcgid: read data timeout in 31 seconds

[Sat Jan 21 13:39:02 2012] [error] [client 66.249.72.38] Premature end of script headers: index.php

[Sat Jan 21 13:39:39 2012] [warn] mod_fcgid: read data timeout in 31 seconds

[Sat Jan 21 13:39:39 2012] [error] [client 66.249.72.38] Premature end of script headers: index.php

[Sat Jan 21 13:39:59 2012] [warn] mod_fcgid: read data timeout in 31 seconds

[Sat Jan 21 13:39:59 2012] [error] [client 207.46.13.95] Premature end of script headers: index.php

[Sat Jan 21 13:40:13 2012] [warn] mod_fcgid: read data timeout in 31 seconds

[Sat Jan 21 13:40:13 2012] [error] [client 66.249.72.38] Premature end of script headers: index.php

In the WebMin, I changed PHP configuration:

  • MySQL connection timeout? 180 seconds

  • Maximum memory allocation 256M

  • Maximum file upload size 2M

Can you help me how to solve this problem?

Thank you in advance.

Kind regards,

Howdy,

Well, it appears as if your application is taking longer than 30 seconds to respond, so it’s timing out. That implies some sort of problem with the application.

However, just to rule this out, you might try going into Server Configuration -> Website Options, and setting the PHP Execution Mode to “CGI”.

-Eric

Hi Eric,

Thanks for your kind respond…

I have changed the setting to CGI and still get 500 error…

Any idea to solve it… :slight_smile:

Kind regards,

Hi all,

Can someone help me to solve this problem…???

Thanks and regards,

You appear to be dealing with an application issue of some sort – so correcting that will involve troubleshooting that specific application.

Your application is taking longer than 30 seconds to respond, so the key will be determining why it’s responding so slowly.

That could be related to a configuration problem with your application, a malfunctioning plugin, or some similar problem.

Just to make sure Apache is working, you could create a test script with the name test.php in your public_html folder:

<?php phpinfo(); ?>

And then access that test.php script from your web browser.

If that works, I’m not sure that we’re going to be able to help you – you may want to ask the support community for your application.

-Eric

Thanks for your kind help Eric,

I have create text.php and I can access the page from browser.

May I know what do you mean with application? I use Wordpress, do you mean its plugin?

If the problem come from plugin, what do you think If I delete all plugins from file manager?

Thanks for your time to help me.

Kind regards,
Leo

Howdy,

If the problem come from plugin, what do you think If I delete all plugins from file manager?

Well, I don’t know what the problem you’re having is, if it’s related to a plugin – but since the test.php script works, it looks like the problem you’re having is somehow related to WordPress.

So as a troubleshooting step, you may want to try removing one or more plugins from your WordPress setup (amongst other things).

I’m not a WordPress guru, so I won’t really be able to resolve the issue for you, but I did find this FAQ here on how to disable WordPress plugins:

http://codex.wordpress.org/FAQ_Troubleshooting#How_to_deactivate_all_plugins_when_not_able_to_access_the_administrative_menus.3F

Hello all!

I had this same problem, and in my apache log messages appeared;

“mod_fcgid: read data timeout in 31 seconds”

“Premature end of script headers: index.php”

I solved my problem by upgrading PHP for PHP version 5.4.

Currently, to install PHP 5.4 on ubuntu is possible using the repository https://launchpad.net/~ondrej/+archive/php5

But I warn you, it worked perfectly on a clean install of Ubuntu 11.10 risking if you install on production server, you may have problems.

These are the steps:

sudo add-apt-repository ppa:ondrej/php5

sudo apt-get update

sudo apt-get install php5

You can check if PHP 5.4.0 is successfully installed with this command:

php5 -v

That’s it!