Receiving the 500 Internal Server error header in Drupal despite your site displaying normally? Here's where to look.
Ah, they joys of TinyMCE. The lovely editor will sometimes insert a line of blank text into the 'PHP Code' window of your custom content kit (CCK) type, this causes an eval() statement to break - you may see an error in your logs along the lines of :-
[Sat Feb 14 11:15:16 2009] [error] [client 64.39.0.38]
PHP Parse error: syntax error, unexpected '<' in
/var/www/vhosts/yourdomain.com/httpdocs/modules/cck/content.module(1638) :
eval()'d code on line 1
If you have display_errors turned off in PHP, eval() can return a 500 Internal Server error header. This will mean Google and any monitoring software will receive a 500 error despite the site seeming to display normally.
So, to solve, head to
site building -> modules -> list
Turn off TinyMCE and save.
Then head to
Content Management -> Content Types -> Edit *your content type* -> manage fields.
Check the PHP Code area of each field for some text that TinyMCE may have dropped in there, delete it. Reenable TinyMCE problem gone!
Now resubmit to Google and breathe a sigh of relief :)
Comments
This was very useful and
This was very useful and probably saved me several hours investigation.
Thank you
Other causes
The error you mention here can also be caused by syntax errors in code inside blocks or the visibilty settings of blocks.
other errors
The error can also be found in php code in your blocks, or the visibility settings of a block.
Post new comment