Laravel: MAMP 从 3.4 升级到 4.1 后没有快乐
Laravel: no joy after MAMP upgrade from 3.4 to 4.1
因为我遇到了一个奇怪的重定向问题,而且我读到 MAMP 可能是我决定升级它的原因。
我设置了虚拟主机,并且在 conf 中启用了它们。
我设置了正确的端口并将 PHP 版本设置为 5.6.31(它是 5.6.10)。
当我启动服务器时发生的事情是我可以打开 laravel 项目 (project.dev) 的欢迎屏幕,但随后路由不起作用并出现错误 404。示例 project.dev/home
或 project.dev/login
等
有什么线索吗?
--- 编辑
我将其添加到我的虚拟主机,现在可以正常使用了。不确定我刚从网上复制的所有东西是否都需要。奇怪的是,我过去没有这方面的任何东西,而且它起作用了。可能是 apache 被配置为允许 mod_rewrite 或什么?
<Directory />
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
在您的 httpd.conf
文件中,将 AllowOverride 指令从 None 设置为全部,例如:
<Directory />
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
Apache 2.3.9 及更高版本中的默认值为 None,之前的版本为 All。来自 online docs:
When this directive is set to None and AllowOverrideList is set to
None, .htaccess files are completely ignored. In this case, the server
will not even attempt to read .htaccess files in the filesystem.
When this directive is set to All, then any directive which has the
.htaccess Context is allowed in .htaccess files.
因为我遇到了一个奇怪的重定向问题,而且我读到 MAMP 可能是我决定升级它的原因。
我设置了虚拟主机,并且在 conf 中启用了它们。
我设置了正确的端口并将 PHP 版本设置为 5.6.31(它是 5.6.10)。
当我启动服务器时发生的事情是我可以打开 laravel 项目 (project.dev) 的欢迎屏幕,但随后路由不起作用并出现错误 404。示例 project.dev/home
或 project.dev/login
等
有什么线索吗?
--- 编辑
我将其添加到我的虚拟主机,现在可以正常使用了。不确定我刚从网上复制的所有东西是否都需要。奇怪的是,我过去没有这方面的任何东西,而且它起作用了。可能是 apache 被配置为允许 mod_rewrite 或什么?
<Directory />
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
在您的 httpd.conf
文件中,将 AllowOverride 指令从 None 设置为全部,例如:
<Directory />
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
Apache 2.3.9 及更高版本中的默认值为 None,之前的版本为 All。来自 online docs:
When this directive is set to None and AllowOverrideList is set to None, .htaccess files are completely ignored. In this case, the server will not even attempt to read .htaccess files in the filesystem.
When this directive is set to All, then any directive which has the .htaccess Context is allowed in .htaccess files.