Support » Localhost Installs » Correct permissions on Xampp

  • Resolved josflachs

    (@josflachs)


    Gents, I have a real problem to get the correct privileges on Xampp for WordPress. I’m working on Ubuntu 19.04.
    My user is: jos.
    Xampp runs on the user daemon and group daemon.
    I have made user jos owner of the htdocs folder:
    sudo chmod -R 755 /opt/lampp/htdocs/
    sudo chown –R jos:jos /opt/lampp/htdocs

    The user jos needs to modify an installed theme. I can only do that by opening the files as su. That’s not a good way to work.

    I have added jos to the group daemon and the user daemon to the group jos. That’s not enough, I still have to work as superuser to make changes.

    So how do I set the privileges for user jos correctly?

    • This topic was modified 1 year, 1 month ago by josflachs.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    It’s not user privileges that are your problem, it’s the file permissions. Typically on servers file ownership belongs to the user Apache/PHP runs as (“daemon” in your case) Since all interaction is via PHP on servers, 755/644 permissions are fine. (only owner can write/modify)

    On localhost, you will want to manipulate files as you, but PHP still needs to manipulate files too. This means files and folders need to grant write permissions to a group that both you and daemon belong to. Thus all files and folders should have 664/775 permissions to make this possible. (owner and group can write/modify)

    This can be a PITA when new folders/files are introduced and they somehow get the usual 644/755 permissions. Typically owned by daemon, so you need to be superuser to change permissions to 664/775. At least once this is done both PHP and your user can both write files as needed.

    Thread Starter josflachs

    (@josflachs)

    Finally, someone with a good answer! I have been fighting with this for almost a fortnight. I have made myself member of daemon, and the user daemon member of the group jos.

    • This reply was modified 1 year, 1 month ago by josflachs.
    Thread Starter josflachs

    (@josflachs)

    I found it. Someone suggested me to check the settings of opt/lampp/temp. Once I change those permissions I could change the User in httpd.conf, restart the server and it works perfect now.

    • This reply was modified 1 year, 1 month ago by josflachs.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Correct permissions on Xampp’ is closed to new replies.