Mac writable folders issue with Xampp

Hi,

First off I have installed a local server on Mac with Xampp.

I am climbing the walls with this one. Mac is not a familiar environment for me :banghead:.

The issue I am having is with making writable folders within htdocs. Please see the screen grab.

So for instance with the ‘Target’ folder; if under Sharing & Permissions I give Read & Write permissions to ‘everyone’, writable.php will echo out ‘is writable: 1’

I cannot figure out why this only works if I give ‘everyone’ these permissions. Am I not accessing the localhost/writable.php as ‘charlie’?

Any guidance would be most appreciated.

Just a dump question:

Why didn’t you use MAMP? This works out of the box as it is for Mac

I would suggest to put your htdocs folder to your document folder and not in the Application folder as this is not designed for holding data

1 Like

Xampp (or more specifically, Apache), doesnt run as the local user. You can check what user it’s running as in the Apache config; alternatively give Everyone write permission to the htdocs directory (Note: And ONLY that directory/its subfolders, or you will screw up other things like phpmyadmin).

1 Like

I have read that. I’ve used Xampp for years and hadn’t considered other options like MAMP. I am also developing this project at home on PC where I have Xampp installed. In that instance everything works out of the box too. I will look into MAMP, thank you.

I would suggest to put your htdocs folder to your document folder and not in the Application folder as this is not designed for holding data

All new to me :slight_smile: It didn’t feel right having it in Applications, so I will move it to documents.

This has been one of the frustrations for me, not knowing what user Apache is running as. When you say Apache config, can you elaborate? httpd.conf? Where in particular?

As a temporary measure I have given ‘Everyone’ permissions to a particular save folder within the app, which is now working.

Thanks both of you.

Click on the Configure button in the XAMPP panel while highlighting the Apache server, and choose Open Conf File.

Check the file for a User directive (it may be easier to find Group, which should be immediately following the user directive.

It was nice in the former days when XAMP (X = Linux), MAMP (M = MAX) and WAMP (W = Windows) were clearly defined and you had one perfectly configured for one system. But nowadays all want to do all and thats were the problems start :slight_smile:

1 Like

Though for what it’s worth, you should be able to determine what user the apache server is running as from the active processes list, which should tell you what user is running apached

ps aux | grep httpd

should help

1 Like

Brilliant :+1:

I did change User from daemon to my local user name in my httpd.conf and that seems to have fixed the issue. Charlie is now able to write to folders, without ‘everyone’ having access. I don’t know if making that change is going to trip me up down the line.

Thanks again.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.