Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am randomly getting a 500 error on my websites, all of which are hosted on a shared server.

It won't happen all the time, just randomly when I will refresh the page I will get a 500 error. It usually will come back after I refresh a few times.

I've been reading about it and have heard that .htaccess files can cause this... I did recently start using an .htaccess file to tell my server to start using php 5. I got the code straight from the hosting company that I am with. This is what is in the .htaccess file:

AddType x-mapp-php5 .php

If anyone has any ideas as to what would be causing this, that would really help.

Thanks!

share|improve this question

migrated from stackoverflow.com Mar 9 '10 at 3:05

This question came from our site for professional and enthusiast programmers.

    
Do you know more about the configuration of the server. Is it an Apache webserver? Is PHP integrated as an Apache Modul mod_php or over CGI, fastcgi. Is a suhosin patch installed on the PHP Version? You will get this information by creating a PHP page with phpinfo(). –  DrDol Aug 14 '10 at 22:36

1 Answer 1

It's unlikely to be that the .htaccess file is wrong. If it was wrong your site would not work at all instead of sporadically.

Is there anything in your Apache error logs? Assuming you're using Apache. Here's a link providing some info on finding your error logs although this will vary depending on how the server is set up. error log info

IIS presumably has an equivalent error reporting mechanism if you're running IIS although it's been a long time since I've used IIS so I'm not sure where it is.

Did you write the code running your site? If so and there's nothing in your error logs you'll probably need to add some error handling to at least tell you where the error is coming from.

share|improve this answer
    
+1 check the logs first. –  Michael Gorsuch Sep 19 '10 at 1:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.