Permission issue on Mac

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

Permission issue on Mac

Postby kenoli » 01. October 2022 18:19

I haven't used Xampp for a number of years and Apple has defeated me in many contexts with the increased permission requirements in the recent Mac systems. I seem to be getting defeated now trying to get access to my site files using Apache in XAMPP.

I'm using the standard install of XAMPP not XAMPP-vm.

First, both the Apache server and the mysql server boot perfectly.

I have XAMPP set up with a symlink in the htdocs file pointing to my site files.

In http.conf i have set: "Options Indexes FollowSymLinks ExecCGI Includes".

When I try to preview (run) any file in my site directory, I get "You don't have permission to access the requested object. It is either read-protected or not readable by the server."

The files open but they won't run.

I even tried copying my site files into the htdocs file to make sure there isn't an issue with the simlink.

I have set my site folders and internal files using "command + i" to read and write. I did the same with the htdocs file.

What am I missing?

Looking forward to being able to use XAMPP again with your help.

Thanks,

--Kenoli
kenoli
 
Posts: 25
Joined: 11. May 2009 19:06

Re: Permission issue on Mac

Postby kenoli » 02. October 2022 22:12

Are there no replies to this because it is a mystery and should work with my setup, or is it a known issue with no solution?

I would help me to know what I am up against.

--Kenoli
kenoli
 
Posts: 25
Joined: 11. May 2009 19:06

Re: Permission issue on Mac

Postby Nobbie » 02. October 2022 22:21

kenoli wrote:Are there no replies to this because it is a mystery and should work with my setup, or is it a known issue with no solution?


Neither nor.

Its missing knowledge about Apache process (i.e. running with its own UserID, different from yours) in conjunction with missing sufficient rights for Apache process to read your local files. You have to grant sufficient rights (with the help of "chmod" command) to your local files AND(!) folders in order to give Apache the rights to read your files.

You also have to configure Apache correctly in order to access your files in the Apache configuration (i.e. "Require all granted").
Nobbie
 
Posts: 13165
Joined: 09. March 2008 13:04

Re: Permission issue on Mac

Postby kenoli » 03. October 2022 00:36

OK. Great. I think I've got that. I'll try to set it up as you indicate.

I may have some questions.

Thanks for the pointers. It gives me some reference point to finding what I need to know.

Getting back to this every 5 years + takes some remembering and at 78 remembering is slower than it used to be.

--Kenoli
kenoli
 
Posts: 25
Joined: 11. May 2009 19:06

Re: Permission issue on Mac

Postby kenoli » 03. October 2022 19:04

Nobbie -- I added the following to the httpd.conf file:

<Directory "/Users/home/Sites"> [path altered for posting, of course]
Require all granted
</Directory>

I left in place the:

<Directory "/Applications/XAMPP/xamppfiles/htdocs">
Require all granted
</Directory

I then used the following unix command:

chmod -R 7777 /Users/home/Sites

I'm getting the same permissions error when I try to preview the file in a browser.

I noticed that ls returns a permission of "-rwxrwxrwx@" for flies in the site. Not sure what the @ means.

What am I missing/getting wrong?

Thanks for your help. It is greatly appreciated. Feeling a bit lost in all of this.

--Kenoli
kenoli
 
Posts: 25
Joined: 11. May 2009 19:06

Re: Permission issue on Mac

Postby Nobbie » 04. October 2022 12:40

kenoli wrote:chmod -R 7777 /Users/home/Sites


Thats the wrong permission, it should be either

chmod -R 777 /Users/home/Sites

or

chmod -R 0777 /Users/home/Sites

I dont know, what 7777 is doing, but it may be the reason for the suspicious "@" in the end of the line. I dont know, what that means (i will have a look into the manual). Maybe thats still the reason for your problems.

P.S.: To which local folder did you put the symbolic link, or where did you put your files? DO NOT link to special folders from clouds or similar (Dropbox, Google Drive or so), that wont run. Also be carefull to link to NAS folders or similar. Only link to "normal" folders in your home folder. And finally also grant Apache access to /Users/home and /Users, as usually Apache does NOT run with a normal UserID with a homefolder in /Users/home and also does not belong to the standard User groups, but instead Apache mostly runs with with a system UserId (like "daemon" for example).
Nobbie
 
Posts: 13165
Joined: 09. March 2008 13:04

Re: Permission issue on Mac

Postby JDLH » 06. October 2022 20:24

Kenoli:

kenoli wrote:I noticed that ls returns a permission of "-rwxrwxrwx@" for flies in the site. Not sure what the @ means.


The "@" in the output of ls -l in the list of permissions codes means that the file or directory has extended attributes. These are little bits of data tacked on to the file or directory, potentially by any bit of software, but most often by the Finder. For instance, if you downloaded this folder from the Internet, Finder might have tacked on a "quarantine" extended attribute, to make it harder for you to accidentally run malware which might be in that folder.

For more information on extended attributes, see the blog post macOS ‘ls -l’ command: What does ‘@’ mean? at https://alvinalexander.com/macos/ls-l-c ... sand-mean/ . Also, in Terminal, give the command man ls. In the description it gives, read the section, "The Long Format". Also, in Terminal, give the command man xattr, to learn more about viewing and removing extended attributes.
JDLH
 
Posts: 23
Joined: 11. September 2022 02:27
XAMPP version: 7.4
Operating System: macOS 12.6


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 37 guests