在進行網頁和服務器的測試時, 有時會提醒 500 Internal Server Error:
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
這可能是由於我們自己的代碼問題, 而引發的服務器在執行時的錯誤, 不過查看一下error log就很容易找到了在哪個地方出現了錯誤。
Linux下如果在安裝Apache服務器時是采用默認安裝方式安裝, 那么服務器的error log一般就存放在/var/log/apache2中, 用vim打開, 查看最下方的日志更新, 你可以再一次測試網頁, 看一下錯誤日志有哪幾行是新增的, 那就是此次出錯的原因。