[英]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.