在 Mac osx 上安装 CakePHP:apache 问题 [英] install CakePHP on Mac osx: apache problems
问题描述
第一次使用蛋糕,我遇到了真正的 apache 问题.出于某种原因,.htaccess 试图找到
First time cake user and I'm having real apache problems. For some reason the .htaccess is trying to find
File does not exist: /Library/WebServer/Documents/Users
但是没有像用户这样的目录.我也尝试过设置以下内容:
but there is no such directory as Users. I have tried setting up the following also:
/etc/apache2/extra/httpd-vhosts.conf
<VirtualHost *:80 >
DocumentRoot "/Users/username/Sites/mysite/app/webroot"
ServerName mysite.dev
ServerAlias www.mysite.dev mysite.dev *.mysite.dev
<Directory "/Users/username/Sites/mysite/app/webroot">
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
/etc/hosts
127.0.0.1 mysite.dev
/etc/apache2/users/username.conf
<Directory "/Users/username/Sites/">
Options Indexes MultiViews FollowSymlinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
这也没有用,但出现了不同的错误 Failed opening required 'cake/libs/cache/file.php'
That also hasn't worked, but with a different error Failed opening required 'cake/libs/cache/file.php'
虽然我宁愿不使用虚拟主机,而是在本地主机上运行它
Although I'd rather not use virtual hosts, and just run it off localhost
推荐答案
似乎对我有用的解决方案是编辑/etc/apache2/users/username.conf 并将其添加到顶部:
Seems like the solution that worked for me was to edit /etc/apache2/users/username.conf and add this at the top:
DocumentRoot "/Users/username/Sites"
默认的 cakePHP 下载现在可以正常运行了.
And the default cakePHP download now runs ok.
这篇关于在 Mac osx 上安装 CakePHP:apache 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!