Sanjeev Sabhlok's notes on technology, hardware, gardening

Internal Server Error: The server encountered an internal error or misconfiguration and was unable to complete your request.

Anubhava solved the problem, thus

"I just applied a carpet bomb process to kill all the processes owned by unix owner [user] and that killed some stray processes and hence released all the held up memory."

And the code used was:

pkill -9 -U [user] -f php

Step 1: Click on "Resource Usage" under "logs" in cpanel. Will generally show you what kind of problem you are experiencing.

Been getting this problem too much, coupled with memory issues.

My problem is less of memory (although I got lots of memory errors on wordpress) but of memory usage on cpanel.

As my hosting company wrote:

"The memory limit on the server on where you are is 132 MB, however, what's happening is that you are reaching to the 1 GB memory limit that your account have, you may want to optimize your wordress".The memory limit on the server on where you are is 132 MB, however, what's happening is that you are reaching to the 1 GB memory limit that your account have, you may want to optimize your wordress".

My cpanel memory usage was JUST OVER 1GB. No wonder the system was crashing all the time.

I finally started exploring this and found the answer (I think – see in red).

How to reduce memory usage by cpanel

http://www.tech-junkie.org/2012/02/05/how-to-lower-cpanel-memory-consumptionusage/

http://forums.cpanel.net/f189/memory-usage-steadily-rising-252051.html

phpMyAdmin to Optimize all databases tables.

http://support.hostgator.com/articles/specialized-help/technical/how-to-optimize-a-mysql-database-using-phpmyadmin

  1. Select the database you want to optimize from the list in the left column, which should take you to the "structure" tab for the database.
  2. Select the tables you wish to optimize by checking the check box in front of each one, or clicking on Select All if you want to optimize all of them.
  3. On the drop down box that says "with selected…" select "Optimize Table."  This will optimize the table and take you to a new screen.

I've optimised all my main wordpress blog tables. Memory usage has dropped well below 1GB.

THIS DID NOT REALLY HELP, IT APPEARS.

So further searches:

http://forums.whirlpool.net.au/archive/2081066

See error log on cpanel

I got lots of the following errors:

couldn't create child process: /opt/suphp/sbin/suphp

[Sat May 18 17:58:00 2013] [error] [client 216.107.145.9] (12)Cannot allocate memory: couldn’t create child process: /opt/suphp/sbin/suphp for /home/sabhlok/public_html/index.php[Sat May 18 17:58:00 2013] [error] [client 216.107.145.9] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/sabhlok/public_html/index.php

 

Hint: http://wordpress.org/support/topic/cannot-allocate-memory-error-1

in your control panel can you see if you have Gzip enabled

This is how: http://forums.cpanel.net/f5/how-do-we-turn-gzip-117001.html. Very messy.

You see the error because incorrect php.conf on your server under /usr/local/apache/conf

Login to your server via WHM 9web host manager) as root & access Service Configuration >> Configure PHP and SuExec. From the drop down for PHP Handler select suphp & click on Save configuration. Try browsing the websites now.

UPGRADE TIME?

"you may need to update your hosting to VPS or Dedicated Server as you mentioned something like that you're running all your websites on Shared hosting plan. You can go with these hosting providers: Dreamhost, Godaddy, Knownhost or Media Temple"

Note I've been getting errors even BEFORE memory was highly used:

Apache version 2.2.23
PHP version 5.3.19
MySQL version 5.1.65-cll
Architecture x86_64
Operating system linux
Memory Usage :       576200 / 1048576 KB
 

Likely to be a low PHP app memory limit. You can easily check by using phpinfo() and increasing the limit as necessary: http://www.hostucan.com/webmaster-tutorials/increase-php-memory-limit. Also, enabling APC byte caching will help speed things up too. Perhaps upload the phpinfo and share a link here?

ADD THIS TO .HTACCESS

http://www.javascriptkit.com/howto/htaccess13.shtml

also
AddType x-httpd-php .html .htm

[Source]

This is applicable for WHM:

http://blog.eukhost.com/webhosting/tweaking-cpanel-for-lower-memory-consumption/

Print Friendly

sabhlok

View more posts from this author
One thought on “Internal Server Error: The server encountered an internal error or misconfiguration and was unable to complete your request.

Leave a Reply

Your email address will not be published. Required fields are marked *