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?
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With