HTTP Error 500 Internal server for php pages and solution

by on October 24, 2006 · 84 comments· LAST UPDATED October 24, 2006

in , ,

You get "500 - Internal server error" error message when a user tries to access your Apache or Lighttpd based dynamic php application (such as forum or blog software).

Generally, to solve this problem you need to take help of log files located at following location:
=> /var/log/message
=> /var/log/httpd/error_logs (/var/log/lighttpd/error_log or /var/log/httpd/error_log)

So you may be wondering why your PHP script throws an Internal Server Error 500.

This error only occurs because of web server software. However after looking through logs you may not find many details. This problem may be caused by:

  • A malformed php cgi script
  • An invalid directive in an .htaccess or other config file
  • Limitation imposed by file system and server software (for example php log file size set to 10Mb)
  • Missing php.ini (or cannot read php.ini file)

In most case it is an invalid .htaccess directive. However recently I came across a web server w/o /etc/php.ini file. A long time ago I setup this server )Apache chrooted jail). So you need to maintain two files one outside jail and another inside jail:
=> /etc/php.ini
=> /chroot/etc/php.ini <-- this file was missing

Many scripts open this file on fly to get correct configuration directives. If this file not found you get error 500. It took some time to figure out this problem. Finally strace helped me out to debug this problem.

For me it was another day with another interesting problem ;)

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 84 comments… read them below or add one }

1 kankan November 15, 2006 at 4:29 am

I get the error message just now
thanks

Reply

2 courtney March 5, 2007 at 5:11 am

i got this same error on my motorola phone and i was curious if there was a way i could get rid of the problem. can you help me out?

Reply

3 UKMoneyPot March 26, 2007 at 4:18 pm

Was there something simple you had to add to the .htaccess file?

Reply

4 cpmresc May 16, 2007 at 8:59 am

Hello there!
Please help me solve http 500 internal server error.
I use Dell Inspiron 6000, Windows Media Center Version 2005.
The machine was configured to run default web services (on the same machine both server and client) with IIS 5.1. Ran some asp scripts; later php5 is also run and machine’s operation has been satisfactory.
In the last week of April, an anti virus (corporate licensed version) Kaspersky 6.0.2.678 is intalled. I didn’t use the machine immediately for my php5 / asp work.
Subsequently the default web server never worked and every time it displayed the above error. Besides, ‘the windows audio tune’ one listens while logging on and off also did not come. all audio stopped working.
As per advise of some experts, Kspersky Anti Virus has been de-installed/removed–no change; the error persisted.
The Windows XP Prof is re-installed. The audio has come back but the default web server didn’t.
Throughout this period the internet web browsing isn’t affected.
Please let me have your valued help.
Thanks–cpmresc

Reply

5 Joe Apache December 2, 2007 at 9:12 am

I had a 500 result code from a GET of a simple PHPinfo .php file on my Windows Vista install of Apache 2.0 and PHP5. Everything in php.ini, httpd.conf was fine. The error log for httpd complained about:
“PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0:” trying to open php.ini or something.
So it’s a permissions problem… but it’s Vista so what to do. Here is what worked after 4 hours of hacking. Open Services control panel, right click on Apache2 service, and change how the service starts/logs on to your Windows logon user. That made PHP module finally click with Apache2. Also, I changed the owner of c:/php to the same user (me) that I changed the httpd service to. Hope this helps save some time for some of you.

Reply

6 gilbert January 13, 2008 at 1:41 am

hi guys if you could help me when i try to go to poetry.com to see the poem i wrote the http 500 error comes out do you think this is a problem of mine or is the website,s problem thanx.

Reply

7 Shivakumar BM May 28, 2008 at 4:21 am

Please help me in solving this probelm:
Am using Dell server with 2003 OS, and Mozilla 1.8.20080.40413 version, I getting 500 Internal Server Error can’t pin point the problem as either refreshing the page or hitting back then clicking on the link again usually makes it appear.

Reply

8 akerajshynna October 8, 2008 at 12:14 pm

pls help me this problemof mind, my profile in tagged cant open.last nyt i change my bck ground then this is a result my profile is error… pls help me this problem,but i recieve the comment from my friends, i open there id but only my profile i can’t open, pls let me have your valued help. thanx

Reply

9 female December 9, 2008 at 7:24 pm

i recieved this error just now after restarting my windows xp based, apache 2.5.6 wiht php 5.2.6 on index.php file…

but with index.html is working fine

and also, phpinfo.php is working 100% fine.

any suggestion to resolve this issue or refferal guide to.

Reply

10 CLee December 11, 2008 at 8:49 pm

This happens when there is a PHP error and your php.ini is set to hide error messages.

There’s 2 ways to handle this:

1. You have to analyze the Web Server log file. If you run Apache on Linux, it’s usually located at /etc/httpd/logs directory. On Windows, ~Apache_Dir/logs directory. Look at the last few lines of error.log file to find what PHP error occurred.

2. If it’s a development box, you can set php.ini file as below so it prints error messages on a browser:
error_reporting = E_ALL
display_errors = On

Alternatively, you can put these in .htaccess file:
php_flag display_errors on
php_value error_reporting 999999999

Hope that helps.

Reply

11 magda December 14, 2008 at 3:00 am

I’m getting HTTP 500 internal error. Please provide an answer. Thanks,
Merry Christmas and Happy New Year!

Reply

12 www.pioneerserviceinc.com January 4, 2009 at 8:07 pm

I M geting error 500 need to clear it

Reply

13 www.pioneerserviceinc.com January 4, 2009 at 8:13 pm

trouble with http error internal server for php pages

Reply

14 jon February 3, 2009 at 9:55 pm

can the solution to this problem be put in better english so we can fix it ourselves?

this problem only occures on my home pc when I try the web site http://www.linkedin.com and I always get the same message ! the rest of the net seems fine!

its now getting to the point that I will reinstall the entire hard drive to fix it – a bit radical for such a silly problem

please help someone

Reply

15 Kalpesh February 14, 2009 at 12:04 pm

hi,
I am getting 500 Internal Server Error in shared web hosting when i try to insert records in database.
I am using linux based in shared web hosting with apache 2.5.6 and php 5.2.6 .
Please help me

Reply

16 demonio February 21, 2009 at 1:18 am

i have 400 error in my internet plase help me to out this error….thanksss

Reply

17 Gourab Singha February 27, 2009 at 5:46 pm

Sir , I aslo got http 500 error.i used yahoo web server.i search logfile for the cause.but i do not find any soloution. i do not find my script is caused for this error or server is the guily. i access mysql database 15times/second.i think this is the cause of the error. please guid me throw give me a mail.

Thanks you in advanse.

Reply

18 aldrin d. boguilis March 6, 2009 at 1:18 pm

i`ve got the 500 error message just right now, pls. tell me what to do.. thnks and godbless..

Reply

19 Peter Laws March 27, 2009 at 11:56 am

I’ve just got this……but what I noticed is it only happens if I’m retrieving over 497 rows from a database on one page……

I’ve fixed it by adding a LIMIT 450 to the query……. So, I’m now thinking it could be a server/memory/mysql issue?

php.ini’s memory_limit is set at 35M

Reply

20 Amitava Das April 8, 2009 at 6:17 pm

Sir,
on click in the submit button do not go to the mail box.

i using PHP for that purpose.

Reply

21 Sang April 9, 2009 at 11:29 am

Having the same issue with Jon — only got the http 500 internal error message on my home pc when trying the web site http://www.linkedin.com. How do we solve this problem? Thanks!!!

Reply

22 alfred balagtas April 11, 2009 at 6:34 am

I also have the 500 internal server error as well as a 404 not found error. do you know how to fix this problem? could you please tell me what to do. thanks

Reply

23 Nanjundappa April 14, 2009 at 4:15 pm

I also have the 500 internal server error , Is it anything to do with zend engine, because it was working fine with wamp setup

Reply

24 santo April 15, 2009 at 2:23 am

i also have the 500 internal error with some comment ” The page cannot displayed, there is a problem with the page trying to reach and it cannot be displayed “, could you please tell me what to do. thanks

Reply

25 john April 24, 2009 at 7:33 pm

please help me solve that problem , error500 internal server. thank you

Reply

26 Omio June 3, 2009 at 8:56 pm

I’hv solved the problem. If you got 500 Internal Server Error Just set these settings with .htaccess :-)

php_value post_max_size 20971520
php_flag magic_quotes_gpc off

========
Omio
http://www.khola-janala.com

Reply

27 MARC June 10, 2009 at 9:37 pm

hello, i have a HTTP 500 INTERNAL SERVER ERROR.
I CAN T READ MY EMAILS OR OPEN THEM ANYMORE IN MY YAHOOMESSENGER 9 FOR VISTA
WHY??? CAN SOMEONE HELP ME PLEASE ASAP
I HAVE A SONY VAIO WITH A VISTA HOME PREMIUM SOFTWARE
THANKS ,MARC

Reply

28 Axel June 11, 2009 at 1:13 am

I have the same problem as marc. My yahoo mail will not open. I just get the http 500 error……since two days, when I let microsoft install updates.

Reply

29 Keith Brezinski June 11, 2009 at 6:10 am

I cannot access my alternate email since I downloaded the new IE8 and Im9.0 keep getting HTTP 500 error! How can I fix ?

Reply

30 thiar July 2, 2009 at 10:25 am

GOOD DAY SIR, I HAVE A ERROR MSG ON MY MAIL SAYS ERROR 500 ERROR.
HAVE TRY BACK OR REFRESH
I CAN T READ MY EMAILS OR OPEN THEM ANYMORE IN MY YAHOO MAIL
CAN SOMEONE HELP ME PLEASE ASAP

BEST REGARDS
THIAR

Reply

31 Martin July 30, 2009 at 3:04 pm

One thing you might want to check is the permissions set on the public_html/ directory on a Linux server.

I’ve had clients set them to 0777 and it causes this error, resetting to 0755 should fix this particular setting.

Reply

32 JDS September 2, 2009 at 5:29 pm

PEOPLE: a “500 SERVER ERROR” IS ON THE WEBSERVER!!!

You can’t fix it on your home computer!!

The software on your home computer — e.g. “Windows Vista Home Premium” — is completely irellevant!!!

CONTACT THE WEBSITE ADMINS!!!

It is unusual, but even large web service providers like Yahoo and Google screw things up sometimes and have 500 Server Errors.

Contact them! e.g. If the problem is on Yahoo Mail, contact help@yahoo.com or similar.

thank you and good night

Reply

33 Jennifer October 28, 2010 at 7:34 pm

thank you for the information ;)

Reply

34 Dah've September 23, 2009 at 12:29 pm

how to fix http server error, i’m connected to the internet but cannot open any web page

Reply

35 rahul October 24, 2009 at 12:17 pm

hello vivek ,
Thanks for the great helpful stuff on the site,
i got the same internal server error ,
i know there are lot reasons for the errors,
i tried >> http://localhost/ >> it worked fine
but when i tried >> http://mydomainname/ or http://myipaddress
i got the internal server error
can you suggest what could be the possible reason for this.

Reply

36 Pat April 7, 2011 at 7:15 pm

Hi, I have the same issue as yours. Please did you ever get a solution to this?

Reply

37 Yawhnie March 17, 2012 at 5:15 pm

I also get the same, but if u’ve got the solution pls hlp me out

Reply

38 Vinayak November 10, 2009 at 7:09 am

Hello everybody,
HTTP 500 Internal Server Error may occurs when maximum execution time for perticular page gets over.
Solution for this is to set the time limit.

Reply

39 Manasa April 10, 2012 at 6:22 am

how can i set time limit??

Reply

40 Beeber November 19, 2009 at 11:12 pm

As if dial-up isn’t bad enough, all of a sudden I get the 500 error everywhere I have to log in. I can’t make a connection with anything I did lately. Missed a GREAT SHELL-SHOCKER AT NEWEGG…couldn’t log in.

Reply

41 elie December 28, 2009 at 8:17 am

hey i have a Nokia N79 and i have a problem with the internet some sites give me the 500 internal server error please help the fastest way to solve…..

Reply

42 arvind February 9, 2010 at 11:49 pm

SIR, I HAVE A ERROR MSG ON MY MAIL SAYS ERROR 500 ERROR.
HAVE TRY BACK OR REFRESH
I CAN T READ MY EMAILS OR OPEN THEM ANYMORE IN MY YAHOO MAIL
CAN SOMEONE HELP ME PLEASE ASAP

Reply

43 JDS February 10, 2010 at 1:14 am

Are you people all still retarded? A “500 Server Error” is not fixable by you. It is on the website itself. Contact the website operators.

Reply

44 Logan December 11, 2010 at 5:57 am

I am the website operator so what do i do to fix it. Im getting this error with godaddy when running a emailing php script on my hosting…

Reply

45 Chase Isabelle February 23, 2010 at 6:13 pm

Hi, everyone,

I think many of you are confused with who should be dealing with these errors. These errors are coming from the server-side, not the client-side. This means that, unless you are the server administrator or something, you cannot correct this error. To have it fixed you should contact the server administrator and have that person examine the server’s error logs.

I’m working on OS X, running Apache 2, and PHP 5.something. When I encountered this error using AJAX calls I found it was because of a syntax error in my PHP script. How did I find that out? Look at the server’s error log file! It’s very useful information.

If you have no idea what I’m talking about, then the only thing you can do is complain to the server’s administrator until he/she fixes it. Sorry, bru.

– Chase

Reply

46 volinh February 26, 2010 at 4:57 am

The server encountered an internal error or misconfiguration and was unable to complete your request.
i get this error when i had run phpinfo(); for test
please help me send your answer to me by email

Reply

47 Martin March 9, 2010 at 3:03 pm

Hello,

Im trying to access my companies intranet from home. But i get the “HTTP 500 Internal Server Error”. The wierd thing is that it works from my sisters computer. We both run windows vista. Can anybody tell me why i cannot access it from my computer?
I have tried to turn of the windows firewall. did not help

Reply

48 Jasper December 11, 2011 at 2:37 pm

did you get your answer to this and how did you resolve this problem because i get this error on my computers at home, but i can access it on my mobile phone and when i ask my friends they said they can access it. Even my web servers support said they can access it, but i can’t on my end……….i know that 500 error is the web server so how in the world that i am the only one getting this error?

Reply

49 Martin March 9, 2010 at 3:25 pm

also tried firefox, opera, ie…same story :/

Reply

50 segavagrant July 14, 2010 at 9:00 am

Mine it said something like… highly trained monkeys… I just said WTF and it said to show them a freakin’ code, which apparently i wouldn’t understand. I just reset I.E. and it was fine again… WHAT THE HELL WAS THAT?! And i’m serious i’m telling the truth. If you don’t believe me and the error someday occurs to you, don’t be asking me for what the hell i know….

Reply

51 Subash Roy July 26, 2010 at 4:28 am

http 500 internal server error

Reply

52 altashia August 8, 2010 at 6:53 am

can you help i was on this website and every time i try to turn the page it pops up 5oo internal server error

Reply

53 Bobbie Mullets August 25, 2010 at 7:23 pm

I NEED HELP FAST AS I GET 500 ERRORS WHEN TRYING TO GET ONLINE BANKING. IF I DONT PAY MY RENT ON TIME IM FUCKED WITH NO HOME. HOW CAN I CONTACT THE WEBMISTER OF THIS SITE? 500 ERRORS is to much for my to handle and microsoft said to call HP but HP said to call this site, do you have a phone number? My bank called me a dick rash but my doctors says I dont have one, maybe thats why my wife left?

How do I fix these 4004 errors?

Reply

54 Mayur September 13, 2010 at 6:43 am

thanks for resolving my errors.

Reply

55 skee October 1, 2010 at 9:44 am

I can’t load my page because I get the 500 error after each release. But if I once set the cakePHP debug level higher then 0 (1, 2 or 3) it works properly even if I set it back. I just need to load the page one time in debug level higher then 0 and it works until I release my code again. It’s very strange to me and I don’t understand this problem. Can anyone help?

Reply

56 kat-dady December 3, 2010 at 2:28 pm

I NEED HELP FAST AS I GET 500 ERRORS WHEN TRYING TO GET ONLINE BANKING. I can access my personal bank account with no problem. I keep getting this (HTTP 500 Internal Server Error) code when trying to acess my small business account. Can anyone explain this and help me overcome this problem?

Reply

57 soscode December 28, 2010 at 4:45 am

i just finished upgrading PHP 5.1 to 5.2 for sugarcrm. Unfortunately the url/website does not update while “click” on user agreement in firefox. My developer told this is due to ownership. please someone help me on this..

Reply

58 Shahulhameed January 13, 2011 at 1:04 pm

For HTTP internal Server error 500 occurred means open the “htaccess” in notepad and save it as notepad. Then you will run surely it will work

Reply

59 Mathieu March 2, 2011 at 6:46 am

hi,
i cannot open my mails due to erroe on page what to do

Reply

60 tom March 9, 2011 at 2:42 am

hi i keep getting

This error (HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying.

For more information about HTTP errors, see Help.

i can only get on the internet via using run as adimistrator i have windows 7 and anysort of internet browser say this i was wandering what this is and how to fix it.

Reply

61 vijayaganth March 25, 2011 at 6:56 am

i am getting internal server error when i run cgi file in linux.
how to rectify this. please help me

Reply

62 Maggie June 23, 2011 at 10:47 pm

Every time i click on a certain page i want to go to, it always says the website cannot display the page, then its say http 500 error, ugh idk wat to do.?

Reply

63 Adrian July 5, 2011 at 10:58 am

In my case it was display_errors = On.
Unfortunately it was a real pain to identify the problem :)

Reply

64 satish September 18, 2011 at 1:00 pm

i want to solve the 500 internal problem

Reply

65 Chris October 13, 2011 at 6:25 am

Also, please notice that you might get 500 Internal Server errors if your script is abnormally terminated by the server, due to it needing more than the allowed memory, or execution time.

You should optimize your scripts not to consume so much memory.
Until you do this, you could try raising the allowed memory by writing:
ini_set(‘memory_limit’, ‘128M’);
at the top of your php files

Reply

66 Darrell November 13, 2011 at 7:58 am

Thanks for that. Solved my issue and saved me a lot of head scratching.

Reply

67 Praveen November 16, 2011 at 6:08 pm

Thanks a lot. Solved my issue quickly

Reply

68 SISWA EDI SUTRISN0 January 18, 2012 at 4:36 am

I have got the 500 error for two days. I have undestood why but not been able to fix it yet.

Reply

69 biola January 18, 2012 at 10:54 pm

i always see http 500 internal. server error html 1500 pls can u help out to solve the problem

Reply

70 JDS January 19, 2012 at 2:00 pm

YOU PEOPLE ARE RETARDED

Reply

71 delhiwonders February 6, 2012 at 11:51 am

Thanks for your help…

Reply

72 oztrout March 20, 2012 at 12:38 pm

I dont see any help here …

Reply

73 Manasa April 10, 2012 at 6:14 am

I have got the 500 error for two days in face book application. .i’m not able to overcome this problem . .and my mobile is Nokia c2-02 . . .please can u suggest anything

Reply

74 ERIN May 8, 2012 at 8:39 am

Lol! JDS is right. Obviously “you people” are retarded because he/she has posted several comments telling you all WHY none of the other potential solutions from other commentors is not able to fix the problem. Wake up you guys!!! What part of “you can’t fix the problem on your own, you have to contact the web server admin.” do you not understand? Nevermind, you will most likely ignore my comment and continue to try and fix the error on your own anyway. Can’t say I’m all that surprised.

Reply

75 John Ortiz May 21, 2012 at 3:00 pm

Excellent guide! Thanks for it!

Reply

76 vysakheg May 30, 2012 at 7:26 am

facebook login is error . 500 internal server error occured . Please help me fast.

Reply

77 wferguson July 17, 2012 at 2:55 pm

I was running into the same problem in Ubuntu attempting to develop my own .php scripts.

Oh sure, test.php with the phpinfo function worked just fine but when I tried running my own scripts…BOOM! Server error 500 Hell.

After having read this page it didn’t exactly tell me what to do but it did point me to the log file which did (contrary to author’s opinion) tell me what exactly the problem was and how to fix it.

sudo nano /etc/suphp/suphp.conf and make sure the following conditions are true:

allow_file_group_writeable
allow_directory_group_writable

And that seems to take care of it.

Reply

78 luckz September 6, 2012 at 4:24 am

docroot=/* may also be necessary.

Reply

79 Patrick Thomas November 23, 2012 at 1:10 am

I am making a php API and when I use a certain set of commands it gives an 500 internal server error. To view my error use hurl.it with the method POST and the parameters:
command=rtab
col=usr
table=DenCrypt_Users

My API is http://www.ip-programs.com/api/sql.php

Reply

80 Naresh December 10, 2012 at 4:30 am

Hello alll i have a problem with .htaccess while adding authentication to the .htaccess file
please anyone help me..

Reply

81 subrata nath March 30, 2013 at 3:03 am

I want to solve http error 500 internal server for php pages and solution

Reply

82 salmi April 1, 2013 at 2:02 pm

Please help me on the same 500 internal error i cnt login to my Facebook account please send me the solution on my email,am using HTC hero

Reply

83 Al June 13, 2013 at 3:29 pm

I found my solution to error 500 was changing the path from “/var/www/ulogin” to “/var/www/ulogin/ulogin”

It wants the path to the application

Reply

84 Karen June 3, 2014 at 3:38 pm

If all else fails, do a factory reset. It solved two problems for me already when something kept popping up and wouldn’t go away.

Reply

Leave a Comment

Previous post:

Next post: