在Mac OSX上安装的CakePHP:apache的问题问题、OSX、Mac、apache

2023-09-02 00:32:35 作者:纸鸢无心却有泪

第一次蛋糕用户和我有真正的阿帕奇问题。出于某种原因,的.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>

这也没有奏效,但有不同的错误打开所需的'蛋糕/库/缓存/为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.