[英]500 internal server error in zend framework
我正在學習zend框架,我根據zend框架的教程設置了它的所有要求,但我仍然得到錯誤這個錯誤:
內部服務器錯誤
服務器遇到內部錯誤或配置錯誤,無法完成您的請求。
請通過admin@example.com與服務器管理員聯系,告知他們此錯誤發生的時間以及您在此錯誤發生之前執行的操作。
服務器錯誤日志中可能提供了有關此錯誤的更多信息。
我該如何解決?
使用Zend Application,您可以看到有關將這些行放在application.ini
的錯誤的更多信息:
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
500個錯誤大多是被發現的。 您可以調試ErrorController.php
查看變量的問題。
此外,最常見的Apache問題:
mod_rewrite
模塊 RewriteBase /
rule(在共享RewriteBase /
上) AllowOverride All
與消息建議一樣,您需要檢查服務器錯誤日志以查看問題實際是什么。 如果您使用的是Apache,那么您需要檢查Apache錯誤日志。 在Linux系統上,這將位於/var/log/apache2/error.log
某個位置。
如果你正在使用NGINX:
更改:
location / {
try_files $uri $uri/ /index.html;
}
至:
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
您沒有加載mod_rewrite
。
找到您的httpd.conf
文件並找到該行:
#LoadModule rewrite_module modules/mod_rewrite.so
從行的開頭刪除#
符號以取消注釋並激活它。
接下來,向httpd.conf中添加一個如下所示的新部分:
<Directory "C:/wamp/www/CRUD_ZEND/public">
Options FollowSymLinks
AllowOverride All
</Directory>
The `AllowOverride` directive is important. By default, `.htaccess` files are not processed unless allowed. This line allows `.htaccess` files in that named directory.
進行這些更改后,重新啟動Apache,然后再次嘗試加載ZF2頁面。
試試這個鏈接
試試這個鏈接,它會對你有所幫助。 你肯定會得到一個有效的解決方案。
你需要兩件事:
對於Apache日志文件通常被存儲在/ etc / httpd的/日志 - 但它取決於你的Linux安裝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.