Googlebot Crawl Error 500 and PHP Error reporting (with a strange solution)

霸气de小男生 提交于 2019-12-11 05:16:20

问题


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:


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).



来源:https://stackoverflow.com/questions/10521244/googlebot-crawl-error-500-and-php-error-reporting-with-a-strange-solution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!