2

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

8
  • 2
    Well, we cannot say much when you don't show the folder/permission list... Might be a permission problem, some of the folders not visible for the web server process? Commented Nov 25, 2012 at 23:40
  • I tried a chmod on the Sites folder but still nothing :( Ill edit and show what I get Commented Nov 25, 2012 at 23:41
  • Attached screenshots of what the browser shows and what is actually in the project folder under the sites directory Commented Nov 25, 2012 at 23:43
  • 1
    And the file permissions of those folders 'app', 'src' and 'web'? Please replace that screenshot with one in detailed view. Or, much easier just post the result of a ls -al ~bengibson/PracTest Commented Nov 25, 2012 at 23:45
  • Hi Sorry for the delay could you check the update screenshot, I tried making the permissions to rwx for all but nothing helped :( Commented Nov 27, 2012 at 19:12

3 Answers 3

2

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

0

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.

1 Comment

Hi, Thanks for the help but that dint work :(, I have attached a screen shot of an ls -la command on the folder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.