Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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|improve this answer
acer@ubuntu:~$ chmod 775 /opt/lampp/htdocs chmod: changing permissions of `/opt/lampp/htdocs': Operation not permitted :( – Delinquent Menace Dec 1 '12 at 10:35
do not forget sudo ;) @DelinquentMenace – Rinzwind Dec 1 '12 at 11:37
You should do 755 instead of 775, you don't want your security breached in 2 seconds. – Joren Sep 6 '13 at 7:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.