2

My head is a bit mashed over this.

I have moved from MAMP to using Mac's own AMP stack, and have got it working, but just CANNOT get the directory permissions right.

My localhost points to ~/Sites and my username appears to be user (in that in the terminal is shows up as user at MacBookPro in ~ $). I also seem to have a group called staff.

I have checked that the user group is set in /private/etc/apache2/httpd.conf (about line 120) as User _www Group _www

The Problem:

Whenever I try and access a URL like localhost/_Projects/fresh2/public/index.php I get a 403 Forbidden error. (This would be the path to my Laravel project).

It looks like I have the opposite of what I want set up, as I can easily see into the localhost/_Projects/fresh2/app/config/ directory and see all these files as a directory listing in my browser, but the one folder that I would expect to see (`public') isn't there (I'm guessing this is down to the permissions).

NOTE: When I run a 'server' via Command line php artisan serve within this Laravel project then I can run the project's index.php and it works at I would expect the app to work, with no permission issues. (But I also use this folder to house other PHP apps (like Codeigniter) so I need to access it via a URL)

Folder Permissions

I have run ls -l within the root of this project folder and this is what I see:

drwxr-xr-x+ 16 user  _www    544 24 Jan 13:19 .
drwxr-x---+  5 user  _www    170 24 Jan 18:50 ..
-rw-r--r--+  1 user  _www     11 19 Jan 02:14 .gitattributes
-rw-r--r--+  1 user  _www    103 19 Jan 02:14 .gitignore
-rw-r--r--+  1 user  _www    145 19 Jan 02:14 CONTRIBUTING.md
drwxr-xr-x+ 14 user  _www    476 19 Jan 02:14 app
-rwxr-xr-x+  1 user  _www   2451 19 Jan 02:14 artisan
drwxr-xr-x+  5 user  _www    170 19 Jan 02:14 bootstrap
drwxr-xr-x+  7 user  _www    238 24 Jan 13:19 components
-rw-r--r--+  1 user  _www    787 24 Jan 13:19 composer.json
-rw-r--r--+  1 user  _www  64982 24 Jan 13:20 composer.lock
-rw-r--r--+  1 user  _www    566 19 Jan 02:14 phpunit.xml
drwxr-xr-x+  7 user  _www    238 19 Jan 02:14 public
-rw-r--r--+  1 user  _www   1795 19 Jan 02:14 readme.md
-rw-r--r--+  1 user  _www    519 19 Jan 02:14 server.php
drwxr-xr-x+ 27 user  _www    918 24 Jan 13:20 vendor

What might I be doing wrong? What other info can I provide?

  • I have given up and just used the standard webroot (/Library/WebServer/Documents/_Projects). It all seems to be working fine there. – al_manchester Jan 24 '14 at 23:51
1

Give ownership to apache user for all files. Here the apache user is _www and try. Use chown for changing ownership. The command will look like something below.

chown _www:_www -R fldername. Here the folder might be the DocumentRoot of your project.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.