Permissions in Ubuntu

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Permissions in Ubuntu

Postby pramclub » 06. December 2008 21:01

I've installed Xampp on Windows before with no problems, but now I'm using Ubuntu 8.10 and have problems with file permissions - I've only been using Ubuntu for a short time, so I'm not very experienced!

I installed Xampp and got the localhost page OK, which showed everything running as I expected. I then wanted to install Joomla, but I got "permission denied" when I tried to copy the extracted Joomla folder into htdocs. I thought I needed to change the owner so that I could copy stuff in, which I did with chown. But now http://localhost/ (and http://localhost/xampp) gives this error message:

Warning: file_get_contents(lang.tmp) [function.file-get-contents]: failed to open stream: Permission denied in /opt/lampp/htdocs/xampp/index.php on line 2
Warning: Cannot modify header information - headers already sent by (output started at /opt/lampp/htdocs/xampp/index.php:2) in /opt/lampp/htdocs/xampp/index.php on line 4

My permissions show as:
-rw-r--r-- 1 dianne root 30894 2007-05-11 13:40 favicon.ico
-rw-r--r-- 1 dianne root 163 2003-10-31 21:15 index.html
drwxr-xr-x 2 dianne dianne 36864 2008-12-06 19:07 joomla15
drwxr-xr-x 2 dianne root 4096 2004-12-26 10:30 webalizer
drwxr-xr-x 7 dianne root 4096 2008-06-10 11:28 xampp

Before I make things worse I thought I'd better get some expert advice. Do I need to change the joomla15 folder permissions to dianne/root, to match xampp permissions?

Posts: 2
Joined: 06. December 2008 20:45

Re: Permissions in Ubuntu

Postby Wiedmann » 06. December 2008 22:41

I thought I needed to change the owner so that I could copy stuff in, which I did with chown.
-rw-r--r-- 1 dianne root 30894 2007-05-11 13:40 favicon.ico

IMHO Apache from XAMPP is running as user "nobody".
AF Moderator
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Permissions in Ubuntu

Postby pramclub » 07. December 2008 20:17

So should I change the permissions for XAMPP to match the permissions I've changed for Joomla?

Posts: 2
Joined: 06. December 2008 20:45

Re: Permissions in Ubuntu

Postby dtommy79 » 28. December 2008 16:51

I have the same problem. how can I solve it?
Posts: 9
Joined: 24. June 2008 21:43
Operating System: Windows 10

Re: Permissions in Ubuntu

Postby Nobbie » 28. December 2008 17:54


Code: Select all
chmod -R 0777 /opt/lampp/htdocs

as su (root) in a terminal (console).
Posts: 8640
Joined: 09. March 2008 13:04

Re: Permissions in Ubuntu

Postby dmphotography » 01. January 2009 18:57

I had this same issue when I was trying to install something in the "htdocs" folder. I did the same thing, I changed the ownership and it made everything mess up like it did on you. My solution, which probably isn't the best answer to this, was I reinstalled XAMPP and this time I created a new directory in /opt/lampp/ called htdocs2 . It is in the same level as htdocs, but it won't effect anything else that is located in the sub directory of htdocs. I then copied everything over to htdocs2 and in the httpd.conf file, I changed my DocumentRoot to htdocs2. The problem I am having so far is when I go to http://localhost/ it wants to go to http://localhost/xampp/ automatically, even though xampp is is not a valid subdirectory. I'm sure it's an easy fix, but you can reach all of your sub directories in your htdocs2 folder via localhost.

This is the easiest way to set it up in my opinion, but I haven't tried the last comment so definitely post if that works for you or not.
For great video and written tutorials and guides on creating your own web server and installing things such as forums, blogs, etc., visit
Posts: 191
Joined: 15. December 2008 14:25
Location: Columbus, MS
Operating System: Windows 7

Re: Permissions in Ubuntu

Postby Kutakizukari » 18. January 2009 05:37

HOWTO: Setup easy web development environment (XAMPP)

Location of files and uploading

XAMPP by default uses /opt/lampp/htdocs as the root web directory. The easiest way to start working on files is to link a folder in your home directory into this directory.
My user name is peter so I have /home/peter/public_html linked to /opt/lampp/htdocs/peter. So if I navigate to http://localhost/peter/ I get a listing of all the files/folders in that directory. (As long is there isn't a index.php/html/etc file)
To set this up, run in a terminal:

1. Make public_html directory in home directory:

mkdir ~/public_html

2. Link to /opt/lampp/htdocs

sudo ln -s ~/public_html /opt/lampp/htdocs/$USER

Now any files and folders you place in ~/public_html will be published to your personal webserver.

Bookmark http://localhost/username to make this easy to access.
Posts: 9
Joined: 18. January 2009 05:28

Re: Permissions in Ubuntu

Postby glitzi85 » 19. January 2009 17:13

@Kutakizukari: Why so complicated:

User avatar
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 8 guests