1

So Google wouldn't crawl anywhere on my live site other than some simple first pages - instead just giving me 500 errors. Fetching as Google in the Webmaster tools showed that it would return the full html output with the header "HTTP/1.0 500 Internal Server Error". I work locally in xampp with display_errors turned on but couldn't see any problems there so I checked the error_log on the live server - nothing there either. Eventually I decided to switch on display_errors on the server - I don't have php.ini access so I just added "php_flag display_errors on" to the htaccess file. When I did this Google no longer returned a 500 internet server error and will now index the page! The weirdest thing is no new PHP errors are being displayed! I just don't get it.

So basically: PHP output causes 500 error for Googlebot until I put "php_flag display_errors on" in .htaccess even though no errors are displayed.

Any help? I obviously would rather have display_errors turned off in the long run but I need to get rid of these 500 errors. I just don't know how to find out what is causing them.

1
  • view the source and double check that the error isn't in a tag that doesn't get displayed such as style, script, head...etc. Also if you are logging php errors, check the php error log to see what error you are getting. Sometimes it is easier to view the errors without all the html surrounding it. May 9, 2012 at 17:48

1 Answer 1

2

Your eval'd code (which is being silenced by a @ sign), has a parse error in it. Because of a bug with PHP (bug #45592), this will result in a PHP 500. Either fix the parse error or get rid of the Eval's somehow (you should rarely need an eval).

1
  • That was exactly it! Thank you so much. I'd vote you up but I only have 1 reputation.
    – Duncan
    May 9, 2012 at 17:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.