开发者

install CakePHP on Mac osx: apache problems

开发者 https://www.devze.com 2022-12-23 20:56 出处:网络
First time cake user and I\'m having real apache problems. For some reason the .htaccess is trying to find

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

精彩评论

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

关注公众号