Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

500 Internal Server Error?

Recently, I put my project which is php+smarty+mysql in my httpd server. But I encountered an error that says:

500 Internal Server Error

My OS is archlinux, and the httpd server and php were installed like this:

sudo pacman -S apache php

If I use a test native php file which contains the following:

  <html>
    <head>
    <title>PHP Test Page</title>
    </head>
    <body>
    This is Arch Linux, running PHP.
    <?php
      phpinfo();
    ?>
    </body>
    </html>

it runs correctly. It tells me that the php can work well. But why is my project with smarty not working? Is there any one who has encountered this problem?

like image 235
Charlie Epps Avatar asked Jul 31 '09 02:07

Charlie Epps


People also ask

What is the reason for 500 internal server error?

The 500 Internal Server error could be caused by an error during the execution of any policy within Edge or by an error on the target/backend server. The HTTP status code 500 is a generic error response. It means that the server encountered an unexpected condition that prevented it from fulfilling the request.

Can you fix an internal server error?

Reload the web page. You can do that by selecting the refresh/reload button, pressing F5 or Ctrl+R, or trying the URL again from the address bar. Even if the 500 Internal Server Error is a problem on the webserver, the issue might be temporary. Trying the page again will often be successful.

How do I fix error 500 in Chrome?

If you are receiving an “Error 500 – Internal Server Error” message while trying to log into Canvas, you will need to clear the cookies on your web browser to resolve this issue.


2 Answers

With the info you provided it's difficult to say.

Error 500 happens because you did some error in the code that is supposed to produce the page, or the code generates some unhandled exception. My suggestion is to visit the page that gives you the 500 error, and then try to comment out all your code. See if the issue is still present. If not, uncomment the code until you find the critical part that originates the error. Could be anything, a typo, a file not found, a logical error, anything.

Also, check in the webserver logs, if you can read them.

like image 128
Stefano Borini Avatar answered Sep 21 '22 18:09

Stefano Borini


Look in your Apache error log (often found at /var/log/httpd/error_log, though this varies greatly). It will have more information about the server error.

like image 44
chaos Avatar answered Sep 24 '22 18:09

chaos