Every new directory and asset requires permissions??

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Every new directory and asset requires permissions??

Postby omarel » 14. December 2014 16:40

I thought I solved this problem but I was wrong.

Every new folder, file, image or asset I add into a directory on my XAMPP local server requires me to give it permissions through the terminal. This is driving me nuts.

I have to use this for each new asset:
chmod -R 777 /applications/xampp/xamppfiles/htdocs/directory/

Please help.

I thought if I did once it would be ok for inherit directories and assets.
omarel
 
Posts: 4
Joined: 08. December 2014 00:55
Operating System: mac osx

Re: Every new directory and asset requires permissions??

Postby Nobbie » 14. December 2014 21:16

omarel wrote:Every new folder, file, image or asset I add into a directory on my XAMPP local server requires me to give it permissions through the terminal.


Of course, as your are logged in as a different user than the user which executes Apache.

omarel wrote:I have to use this for each new asset:
chmod -R 777 /applications/xampp/xamppfiles/htdocs/directory/


This affects only the already installed files. It does not affect files, which are created after.

omarel wrote:I thought if I did once it would be ok for inherit directories and assets.


No, this is wrong.

The very best thing you can do:

edit httpd.conf and watch out for the "User = ..." statement. This is the definition, which user does execute Apache. Replace "daemon" (or whatever you find there) by your personal UserID. After then run a "chown" command to change the owner of htdocs to your userid:

sudo chown *yourUserID* /applications/xampp/xamppfiles/htdocs (where *yourUserID* is your UserID)

And then restart Apache.
Nobbie
 
Posts: 13182
Joined: 09. March 2008 13:04

Re: Every new directory and asset requires permissions??

Postby omarel » 14. December 2014 22:19

I don't see User in my file. Here is what i see. I also installed a bitnami plugin which runs the wordpress so I don't want that to break either.

Which line should I change here?

Alias /bitnami/ "/Applications/XAMPP/xamppfiles/apache2/htdocs/"
Alias /bitnami "/Applications/XAMPP/xamppfiles/apache2/htdocs"

<Directory "/Applications/XAMPP/xamppfiles/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Include "/Applications/XAMPP/xamppfiles/apps/wordpress/conf/httpd-prefix.conf"
omarel
 
Posts: 4
Joined: 08. December 2014 00:55
Operating System: mac osx

Re: Every new directory and asset requires permissions??

Postby Nobbie » 15. December 2014 19:57

omarel wrote:I don't see User in my file.


Either find it and replace it, or insert it.

omarel wrote:Which line should I change here?


None. Are you kidding or what?? I said "User = ..." and nothing else, and nothing else has to be changed. In case of any further questions: read the Apache documentation. It is meant for reading.
Nobbie
 
Posts: 13182
Joined: 09. March 2008 13:04

Re: Every new directory and asset requires permissions??

Postby omarel » 16. December 2014 05:33

Thanks Nobbie for your help!

For anyone else who might have this problem the solution was to add this to the http.conf file and then restart your server:

Code: Select all
User yourUserID


Replace yourUserID with your computer username.

Then run this code in your terminal like Nobbie said:

Code: Select all
sudo chown yourUserID /applications/xampp/xamppfiles/htdocs
omarel
 
Posts: 4
Joined: 08. December 2014 00:55
Operating System: mac osx


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 70 guests