开发者

install CakePHP on Mac osx: apache problems

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.d开发者_如何转开发ev
<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>

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


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"

And the default cakePHP download now runs ok.


Looks like Apache is trying to find your webroot in a different location--the default location, if memory serves. If you want to use virtual hosts (which would be my recommendation, for whatever it's worth), ensure that the NameVirtualHost directive is uncommented. By default, it's commented out:

NameVirtualHost *:80

If you'd prefer not to use virtual hosts for whatever reason, ensure that the NameVirtualHost is commented out (your <VirtualHost> blocks will be ignored) and change the DocumentRoot value to the proper directory:

DocumentRoot "/Users/username/Sites/mysite/app/webroot"

That should tell Apache to look in the right place.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜