gpt4 book ai didi

apache - WAMP 虚拟主机 AllowOverrides 全部抛出 500 错误

转载 作者:行者123 更新时间:2023-12-01 11:02:00 24 4
gpt4 key购买 nike

我有一个在 WAMP 上完美设置的虚拟主机,就像这样...

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#


<VirtualHost *:80>
DocumentRoot "C:/wamp/www"
ServerName localhost
ServerAlias localhost

</VirtualHost>

<VirtualHost *:80>
DocumentRoot "D:\Work\BOT\public"
ServerAlias bot.dev
ServerName bot.dev
<Directory "D:\Work\BOT\public">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

我在 bot.dev 上运行 Zend Framework 应用程序,因此我需要 AllowOverrides 才能使 url 正常工作。但是,当我将 AllowOrverride 更改为 All 时,我收到了 500 Internal Server Error。

我会向任何可以帮助我的人发送一些重要的善意信号。

更新:

我打开服务器日志,发现如下错误...

D:/Work/BOT/public/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

所以问题一定出在.htaccess中:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

还不确定。

最佳答案

在这里找到答案:http://www.phpfreaks.com/forums/index.php?topic=260159.0

enable the Apache module called mod_rewrite.

To do this left click WAMP tray icon and select Apache > Modules > rewrite module

关于apache - WAMP 虚拟主机 AllowOverrides 全部抛出 500 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9899087/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com