1

I have this url that seems to work fine but it returns a 500 error.

http://comehike.com/outdoors/hike_widget.php?hike_id=164&height=700&width=500

Any idea why that is possibly happening? I have like 10k such errors in my google webmaster tools :(

3 Answers 3

2

If you can create a .htaccess file (or already have one), put this code at the top:

# enable PHP error logging
php_flag  log_errors on
php_value error_log  /path/to/htdocs/PHP_errors.log

Create a blank PHP_errors.log file in the directory specified in your .htaccess file and set its permissions to 777. Now refresh the page that's giving the 500 error and check if that log file now contains an error(s).

1

HTTP response headers are separate to the actual content that is returned. You can return any page with any response code (that's how custom 404 errors work).

The problem most likely lies with your server or PHP code. Check that there is no 500 error being sent in PHP (it would use the header() function), check there are no errors in .htaccess and that your server settings are not breaking anything.

If you are on shared hosting you'll probably need to contact your host since it may be their fault.

1

hike_widget.php is returning an error 500. Check in chrome developer tools under Network. These are the headers for that file

Click on the file in the Networks left side window then view the headers on the right

Your Answer

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

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