How to change folder permissions to read, write and execute

36,403

For settings permissions you need the command chmod.

The following permissions are enough for files: sudo chmod 664 /opt/lampp/htdocs/myfirstfile.php inside a directory. For directories sudo chmod 775 /opt/lampp/htdocs is enough.

You can add -R as an option to set it from where you are and everything below but please do not open permission more than needed (even though the creator of XAMPP does not care for security).


And please use the native LAMP stack. It is a bit harder to master but it does have a decent security out of the box.

Share:
36,403

Related videos on Youtube

Bharat
Author by

Bharat

Updated on September 18, 2022

Comments

  • Bharat
    Bharat over 1 year

    I installed XAMPP, but I'm not able to create or save files in htdocs folder. This is what I get to see when I try to save a file.

    The document could not be saved, as it was not possible to write to /opt/lampp/htdocs/myfirstfile.php.

    Check that you have write access to this file or that enough disk space is available.

  • Bharat
    Bharat over 11 years
    acer@ubuntu:~$ chmod 775 /opt/lampp/htdocs chmod: changing permissions of `/opt/lampp/htdocs': Operation not permitted :(
  • Rinzwind
    Rinzwind over 11 years
    do not forget sudo ;) @DelinquentMenace
  • Joren
    Joren over 10 years
    You should do 755 instead of 775, you don't want your security breached in 2 seconds.