Can't write to htdocs directory

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

Can't write to htdocs directory

Postby robertf57 » 19. February 2018 23:16

I've just installed XAMPP but I can't write to the htdocs directory. It's located in a weird location, ~/.bitnami/stackman/machines/xampp/volumes/root. At first I tried to take ownership of the directory by running this command:

Code: Select all
sudo chown -R <myname>:wheel htdocs


But that just gave me a bunch of "Operation not permitted" errors. Then I ran across this question "Permissions error" here at https://community.apachefriends.org/f/viewtopic.php?f=29&t=76007&p=257717&hilit=can+write+htdocs#p257717 which said:

I had the same issue and here is the solution I found:
First make sure all your services are running, enable the network and mount the volume.
Next, go to your mounted volume in Finder and right-click the folder you want to change permissions of and select "Get Info".
Now, on the right hand bottom side of the Info screen that ops up, you'll see a small lock symbol.
Click that symbol and the login pop up opens, asking you for your admin password.
Now you can change the permissions for the folder in the Sharing & permissions part of the Info screen.


But when I bring up the Info window for the htdocs folder, the "Locked" checkbox is disabled. If I right-click on the mounted "lampp" folder in Finder, it doesn't have a "Get Info" menu item.

How do I make the htdocs directory writable?
robertf57
 
Posts: 3
Joined: 19. February 2018 22:59
XAMPP version: 7.2
Operating System: MacOS 10.12

Re: Can't write to htdocs directory

Postby Nobbie » 20. February 2018 13:29

You cannot change the permission of that file system, as it is a mounted folder to a virtual volume and the permissions are defined by the mounting process. Either use supervisor (administrator) rights (probably via "sudo cp ..." or similar) or do not use Xampp-VM (you installed the very specific VirtualMachine). If you install one of the "normal" OSX Xampp versions instead, you wont have any problems with remote virtual folders etc.

I really wonder why so many people install Xampp-VM instead of simply Xampp and after they cannot handle it.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Can't write to htdocs directory

Postby robertf57 » 20. February 2018 17:54

I deleted XAMPP from my computer and installed MAMP instead. It was extremely easy to install and no configuration was necessary. You simply start MAMP, copy your HTML or PHP files to /Applications/MAMP/htdocs, and you're good to go. Apache always makes things so difficult.
robertf57
 
Posts: 3
Joined: 19. February 2018 22:59
XAMPP version: 7.2
Operating System: MacOS 10.12

Re: Can't write to htdocs directory

Postby Nobbie » 21. February 2018 10:38

Thats exactly the same way how it works if you install Xampp instead of Xampp-VM, because of that i wonder why you choose Xampp-VM instead of simply Xampp?
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Can't write to htdocs directory

Postby elsheepo » 01. March 2018 09:59

Hello, I am having the same issue. I've installed XAMPP-7.2.2 for now, and it works fine, but I would like to use XAMPP-VM. I'll be honest and say I haven't read any of the documentation, but I digress... So I was able to mount the Volume, and Explore the Volume as a Shared Network Resource, but I was unable to write to it at all. I understand that it's a VM, and thus, not a part of my file system. So how do I upload files to the document root, or other directories, such as mysql/ etc... Do I use SSH? If so, what are the credentials I use to log into the VM via SSH with?
elsheepo
 
Posts: 3
Joined: 28. February 2018 10:18
Location: Nagaoka-shi, Niigata-ken, Japan
XAMPP version: 7.2.2
Operating System: macOS-10.13.3

Re: Can't write to htdocs directory

Postby csolje » 01. March 2018 11:33

Then why did Apache Friends then make a XAMPP-VM if everything is so hard to do?
csolje
 
Posts: 1
Joined: 08. January 2018 06:53
XAMPP version: 7
Operating System: MAC-OS

Re: Can't write to htdocs directory

Postby elsheepo » 01. March 2018 23:25

I think it’s a good idea, I poked around the terminal a bit this morning and found a lot of configuration files. When opening the Terminal from XAMPP-VM it logs into root@debian, so I’m assuing it’s using SSH to do so. Having XAMPP run as a VM gives you a complete linux environment to operate the server in, including all the utilities that Linux offers (less, find, ifconfig, etc...) just need to know the root’s password so I can scp my database files into the stack instead of recreating all of them. Is there any documentation online for XAMPP-VM?
elsheepo
 
Posts: 3
Joined: 28. February 2018 10:18
Location: Nagaoka-shi, Niigata-ken, Japan
XAMPP version: 7.2.2
Operating System: macOS-10.13.3

Re: Can't write to htdocs directory

Postby robertf57 » 02. March 2018 17:42

Apache seems to like to make everything harder than it needs to be. :D
robertf57
 
Posts: 3
Joined: 19. February 2018 22:59
XAMPP version: 7.2
Operating System: MacOS 10.12

Re: Can't write to htdocs directory

Postby Nobbie » 02. March 2018 18:49

elsheepo wrote:including all the utilities that Linux offers (less, find, ifconfig, etc...)


Doesnt OSX (a Unix environment as well) already offer all these utilities?
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Can't write to htdocs directory

Postby elsheepo » 02. March 2018 21:50

To the OP: I have been looking into this again this morning, as you stated, the volume is mounted at ~/.bitnami/stackman/machines/xampp/volumes/root, here is a detailed listing of that directories' contents.
Code: Select all
Palm:root beatzz$ ls -l
total 23776
-rw-r--r--   1 root    wheel     86263 Dec 22 00:48 COPYING.thirdparty
-rw-r--r--   1 root    wheel     19510 Dec 22 00:48 README-wsrep
-rw-r--r--   1 root    wheel       830 Feb 16 09:24 RELEASENOTES
drwxr-xr-x   5 root    wheel      4096 Feb 16 09:55 apache2
drwxrwxr-x   2 root    wheel     12288 Feb 16 09:55 bin
drwxr-xr-x   2 root    wheel      4096 Feb 16 09:55 cgi-bin
-rwxr-xr-x   1 root    wheel     27400 Feb 16 09:53 ctlscript.sh
drwxrwxr-x   3 root    wheel      4096 Feb 16 09:55 error
drwxr-xr-x   8 1000    wheel      4096 Mar  2 05:22 etc
drwxrwxrwx   8 1000    wheel      4096 Mar  3 05:12 htdocs
drwxr-xr-x   3 root    wheel      4096 Feb 16 09:55 icons
drwxr-xr-x   2 root    wheel      4096 Feb 16 09:55 img
lrwxrwxrwx   1 root    wheel        16 Feb 16 09:54 lampp -> /opt/lampp/xampp
drwxr-xr-x  15 root    wheel     12288 Feb 16 09:55 lib
drwxr-xr-x   2 root    wheel      4096 Feb 16 09:55 libexec
drwxr-xr-x   2 root    wheel      4096 Feb 16 09:55 licenses
drwxr-xr-x   2 daemon  daemon     4096 Mar  3 05:10 logs
-rwx------   1 root    wheel   3361003 Feb 27  2017 manager-linux-x64.run
drwxr-xr-x   2 root    wheel      4096 Feb 16 09:55 modules
drwxr-xr-x   3 root    wheel      4096 Feb 16 09:55 mysql
drwxr-xr-x   2 root    wheel      4096 Feb 16 09:55 pear
drwxr-xr-x   3 root    wheel      4096 Feb 16 09:55 php
drwxr-xr-x  12 root    wheel      4096 Feb 16 09:55 phpmyadmin
drwxr-xr-x   3 root    wheel      4096 Feb 16 09:55 proftpd
-rw-r--r--   1 root    wheel       906 Feb 16 09:54 properties.ini
drwxr-xr-x   2 root    wheel      4096 Feb 16 09:55 sbin
drwxr-xr-x   3 root    wheel      4096 Feb 16 09:55 scripts
drwxr-xr-x  49 root    wheel      4096 Feb 16 09:55 share
drwxrwxrwx   2 daemon  daemon     4096 Mar  3 05:10 temp
-rwx------   1 root    wheel   8308055 Feb 16 09:54 uninstall
-rw-------   1 root    wheel    240995 Feb 16 09:54 uninstall.dat
drwxr-xr-x  10 root    wheel      4096 Mar  3 04:35 var
-rwxr-xr-x   1 root    wheel     15201 Jul 22  2013 xampp
You'll notice that the sub-directories htdocs/ and etc/ are owned by user "1000", in those two directories, I have write permission for sure, tested and works, but I am unable to write to any of the root owned directories, even using sudo.
elsheepo
 
Posts: 3
Joined: 28. February 2018 10:18
Location: Nagaoka-shi, Niigata-ken, Japan
XAMPP version: 7.2.2
Operating System: macOS-10.13.3

Re: Can't write to htdocs directory

Postby Nobbie » 02. March 2018 22:48

Why don't you just read the Xampp-VM documentation instead of wildly guessing around? See "More Info about Xampp-VM" in the download links: https://www.apachefriends.org/blog/new_ ... 70628.html
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Can't write to htdocs directory

Postby Cyclefitness » 11. March 2018 19:53

I have been struggling for the last two hours trying to fix the fact that I can't write to the htdocs directory. I have followed all instructions shown at this post https://www.apachefriends.org/blog/new_xampp_20170628.html but I don't have permissions to create a directory under htdocs. Please help. I'm so annoyed. Running MAC OSx High Sierra.
Cyclefitness
 
Posts: 3
Joined: 11. March 2018 16:23
XAMPP version: 333
Operating System: OS

Re: Can't write to htdocs directory

Postby Cyclefitness » 11. March 2018 20:07

I read carefully thru this thread, saw that @Nobbie seemed to be irritated by a user's "VM" install. Realize I have no idea what I installed, so went back and uninstalled, then carefully selected the non VM version and problem solved!!!

I'm not a developer - don't even know what the heck VM would get me. Thanks for the conversation.
Cyclefitness
 
Posts: 3
Joined: 11. March 2018 16:23
XAMPP version: 333
Operating System: OS

Re: Can't write to htdocs directory

Postby SEB » 14. June 2022 09:49

Make sure the XAMPP app is running then:

Under General Tab, in XAMPP app, click Open Terminal
A terminal will be launched with something like, root@debian:~#, on the terminal shell
on that terminal shell, type, chmod -R 0777 /opt/lampp/htdocs/ and enter
Exit, the terminal and you be good to go

Found this while searching about. Hope it helps!
SEB
 
Posts: 1
Joined: 14. June 2022 09:47
XAMPP version: 8.1.6
Operating System: macos catalina

Re: Can't write to htdocs directory

Postby Nobbie » 19. August 2022 18:02

JackieYanger wrote:Apache always makes things so difficult.


Definately: NO!

Thats not an Apache issue (Apache comes with Xampp and MAMP as well), its the problem of running Xampp in a Virtual Machine. There is also an Xampp Installer which installs into /Applicatiions/Xampp instead and its as easy to use as MAMP.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 4 guests