Server error 500 [closed]

∥☆過路亽.° 提交于 2019-12-13 09:55:38

问题


I am working on drupal7.

When I try to open the website, it gives internal server error:

HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

But when we open this on Firefox, it does nothing. Any idea?


回答1:


This is due to the error in the code.Enable error reporting and see what happens.

This code will help you-

ini_set('display_errors', '1');
error_reporting(E_ALL ^ E_NOTICE);

Read more- http://pcsupport.about.com/od/findbyerrormessage/a/500servererror.htm




回答2:


The PHP script gives an error but since your PHP settings are set to production mode it don't produces an error and leaves the error handling to your webserver (most of the times Apache).

You can do one of the following things:

  1. Locate the CORRECT php.ini file and change error_reporting to E_ALL and display_errors to 1 (restart server is neccesary).
  2. Put this in the first loaded PHP file (index.php?) error_reporting(E_ALL); ini_set('dislay_errors', 1);
  3. Each webserver has it's own error logs you can also check this in stead of let PHP output the error, see (http://httpd.apache.org/docs/2.0/logs.html).

But when you do one of the things above you only will see the error message, fixing the problem is step two.



来源:https://stackoverflow.com/questions/14152801/server-error-500

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!