Php 安装带有.htaccess 403的ZF2 500错误(禁止的错误)而没有.htaccess
我一直在尝试设置ZF2,我在Php 安装带有.htaccess 403的ZF2 500错误(禁止的错误)而没有.htaccess,php,.htaccess,configuration,zend-framework2,apache2,Php,.htaccess,Configuration,Zend Framework2,Apache2,我一直在尝试设置ZF2,我在/home/jack/instantpk/framework/中设置了目录,其中“public”目录包含该文件夹中的.htaccess和index.php,即/home/jack/instantpk/framework/public/index.php 我已将主机配置为: 127.0.0.1 zf2.localhost.com 一切就绪 我还修改了/etc/apache2/sites available目录中的000 default.conf文件,使其现在可以读取 &
/home/jack/instantpk/framework/
中设置了目录,其中“public”目录包含该文件夹中的.htaccess和index.php,即/home/jack/instantpk/framework/public/index.php
我已将主机配置为:
127.0.0.1 zf2.localhost.com
一切就绪
我还修改了/etc/apache2/sites available
目录中的000 default.conf
文件,使其现在可以读取
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName zf2.localhost.com
ServerAlias zf2.localhost.com
DocumentRoot /home/jack/instantpk/framework/public
<Directory /home/jack/instantpk/framework/public>
AllowOverride All
Order allow,Deny
Allow from all
</Directory>
</VirtualHost>
如果删除.htaccess文件,则会出现403禁止的错误:
您没有访问此服务器上的/****的权限。
如果该文件存在,我会得到一个500错误:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
当我尝试访问http://zf2.localhost.com/
我已经摆弄了一段时间了,在网上阅读似乎没有什么有用的东西——如果有人能给我指出正确的方向,我将不胜感激 我的问题是没有启用mod rewrite,我最近更新了apache版本,因此.htaccess抛出了一个500错误
至于403错误-我不确定,我通过将我的目录移动到/var/www文件夹中解决了这个问题
我犯了相当愚蠢的错误,希望这对以后的其他人有帮助 别忘了把你的答案标记为正确,因为它解决了问题。你不能在48小时内@foozy你是否启用了mod_重写?
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.