安装 CakePHP.无法访问资产.找不到样式.网址重写


Installing CakePHP. Unable to access assets. Dont't find styles. URL Rewriting

我开始用cakePHP开发,按照官方网站:http://book.cakephp.org/2.0/en/installation.html中显示的步骤。

我将完整的蛋糕文件夹放在我的网络文档根目录上。当我尝试在www.mydomain/cakephp上显示欢迎网页时,我的问题出现了,因为网络没有找到正确的资产路径,成为没有任何风格的网络。

对于我的发现,这可能是我的 apache 上的mod_rewrite配置问题,我已经尝试了官方文档告诉 URL 重写的所有内容:

- 确保允许 .htaccess 覆盖,并且对于正确的文档根目录,将允许覆盖设置为"全部":

<Directory />
  Options FollowSymLinks
  AllowOverride All
  #Order deny,allow
  #Deny from all
</Directory>

-确保您正确加载mod_rewrite:我的htppd.conf已经设置了mod_rewrite:

LoadModule rewrite_module libexec/apache2/mod_rewrite.so

我在 Ubuntu 上使用 apache。

无论如何,似乎 url 重写不起作用。我现在真的不知道如何处理这个问题。知道吗?

我遇到了同样的问题,有很多关于这个问题的帖子。面包店的这个很好地覆盖了它。

http://bakery.cakephp.org/articles/BBBThunda/2010/02/25/troubleshooting-cakephp-installation-issues-related-to-apache-2-mod_rewrite-for-beginners

如果是 mod 重写的问题,作为额外的提示,您可以尝试在控制台上运行下一个命令:

$ a2enmod rewrite