OSX本地环境中的Symfony2权限问题

I wanted to try out the local apache environment that comes with OSX Mountain Lion.

I did the basic setup and placed a project in the root directory

/Library/WebServer/Documents/

Jumped over too localhost in my browser and everything was working as expected.

However I then decided to follow this guide in order to use the Sites folder in my home directory, for simplicity sake.

http://osxdaily.com/2012/09/02/start-apache-web-server-mac-os-x/

I then reset apache and added this to my browser

http://127.0.0.1/~bengibson/PracTest/

The browser shows a list of a few of the files and directories in the project folder but not all of them :S.

I tried to navigate to one of the missing folders

http://127.0.0.1/~bengibson/PracTest/web/app_dev.php

But I get a forbidden message :(

Anyone know what this needs?

Just for reference here is the project folder

enter image description here

Heres the detailed view in of the folder in terminal

enter image description here

And here is what shown in the browser

enter image description here

sounds like permissions.

right click folder, get info, unlock with admin password bottom right and make all users able to read and write. then click the gear looking menu below it and tell it to apply to all contents within as well.

I ran into this problem before on OS X when I downloaded the archive file for the Symfony 2 Standard Edition directly in the browser.

The @ symbol at the end of the permissions table indicates that the file has additional attributes. You can see these additional attributes by typing the following command in Terminal as an example, explained here.

$ xattr -l ~/Sites/PracTest/web/app_dev.php

The result returned is com.apple.quarantine. This is the way OS X protects potentially malicious files downloaded from the internet from being readily available, which is why in Finder you get the warning box alerting you about opening a file downloaded from the internet.

In your case, to remove these extended attributes, run

$ xattr -rd com.apple.quarantine ~/Sites/PracTest

IF you wanted to know what this command does:

The -d flag removes the extended attribute specified after it, followed by the path. The -r flag acts recursively, on all subfolders and files.

You should now be able to access both app.php and app_dev.php in the browser.

I'd also like to take the opportunity to recommend creating a new Symfony2 project with Composer rather than downloading it directly. It's hard to look back.

For anyone else who may happen on this blog, I had a similar issue and after a bit of looking around I found that I had forgotten the 'FollowSymLinks' Option in the username.conf file