Error: unable to create tmp file in /opt/lampp/htdocs

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

Error: unable to create tmp file in /opt/lampp/htdocs

Postby Mezo » 16. February 2014 00:14

Hi there,

New XAMPP instal on Mint 16, when i try to save a test file (test.php) i come up with the following errors, the first is using Subline 3 & to rule out the text editor the second is using Gedit.

Unable to save /opt/lampp/htdocs/test.php
Error: unable to create tmp file in /opt/lampp/htdocs

Could not save the file /opt/lampp/htdocs/test.php.
You do not have the permissions necessary to save the file. Please check that you typed the location correctly and try again.

Help would be appreciated here please, never had this issue on previous mint instal`s or the windows days.

Mezo.
Mezo
 
Posts: 7
Joined: 11. February 2014 08:01
Operating System: Linux Mint 16

Re: Error: unable to create tmp file in /opt/lampp/htdocs

Postby Nobbie » 16. February 2014 15:48

This is not a problem of Xampp. It is a standard Linux issue.

All files and folders under Linux have rights, which users may change the files or folders and obviously the UserId you are using may not change test.php in /opt/lampp/htdocs or may not create files in /opt/lampp/htdocs.

There is no Xampp involved. You should read some basic Linux tutorials and learn how to understand the rights management.
Nobbie
 
Posts: 8772
Joined: 09. March 2008 13:04

Re: Error: unable to create tmp file in /opt/lampp/htdocs

Postby Mezo » 16. February 2014 23:18

Thank you Nobbie, i should have seem the clue word "permission" in the error, i never had this issue when i was using Linux Mint 13 (32bit) XAMMP worked straight out of the box.

Mezo.
Mezo
 
Posts: 7
Joined: 11. February 2014 08:01
Operating System: Linux Mint 16

Re: Error: unable to create tmp file in /opt/lampp/htdocs

Postby Nobbie » 18. February 2014 11:44

Mezo wrote:i never had this issue when i was using Linux Mint 13 (32bit) XAMMP worked straight out of the box.


Yes, the problem is, that you "normally" work with files only in your "Home Directory" (/home/Userid) and your UserId has all permissions to change any files there. But now you are leaving your home, you are entering /opt/lampp and /opt/lampp/htdocs - these directories are not part of your home and you do not have sufficient permissions for these directories. Thats all.

You may change this easily by changing either:

a) the permissions of /opt/lampp and all folders beyond (chmod -R 0777 /opt/lampp/htdocs)

or

b) change the Owner of /opt/lampp/htdocs to your own UserId (chown UserId /opt/lampp/htdocs)


If you decide to change the ownership of /opt/lampp/htdocs to your UserId, it is good idea also to change the user which executes Apache as well to your UserId (you find a line "User = ...." in httpd.conf). I would do so, because you are the only real user of your linux PC anyway. Beware that you have to execute the chown and chmod commands as root (su).
Nobbie
 
Posts: 8772
Joined: 09. March 2008 13:04

Re: Error: unable to create tmp file in /opt/lampp/htdocs

Postby Mezo » 18. February 2014 16:04

Thanks again for your reply Nobbie, i have posted the question of permissions on the Mint forum but no reply there yet, i also looked for some basic Linux tutorials (as you suggested) but Mints site is pretty basic so ill have a peek on Ubuntu`s site.
You can guess im fairly new to Linux but after two years using it i would never switch back to Windows, i had great satisfaction formatting over Windows 8 intalling Linux Mint 16 in its place. :D

I have been running a forum for three years now & want to learn PHP to customize my site.

I will have a play with your suggestions later (with a fresh head) its 2am right now, but thanks for expaling why i had no issues in the old Mint compared to this new install & the Home folder etc, fully understand that.

Regards,

Mezo.
Mezo
 
Posts: 7
Joined: 11. February 2014 08:01
Operating System: Linux Mint 16

Re: Error: unable to create tmp file in /opt/lampp/htdocs

Postby Mezo » 19. February 2014 04:01

None of this is working either? just getting "Operation not permitted"

I tried ((chmod -R 0777 /opt/lampp/htdocs) no joy plus before i tried (chmod -R 0755 /opt/lampp/htdocs) and nothing, just getting "not permitted"

Changing ownership was beyond me? i did try but im not 100% sure what im supposed to be doing in regards (chown UserId /opt/lampp/htdocs) or (you find a line "User = ...." in httpd.conf)

If by user id you mean my login name? i tried that but same thing "not permitted"

Frustrating as i want to get on with XAMPP as before but now im battling this security stuff, am i able to uninstall this from this directory & put it in HOME as it was on Mint 13 ? worked well like that.

Mezo.
Mezo
 
Posts: 7
Joined: 11. February 2014 08:01
Operating System: Linux Mint 16

Re: Error: unable to create tmp file in /opt/lampp/htdocs

Postby Mezo » 19. February 2014 05:31

OK Nobbie its fixed, after some reading i found rather than using SU (super user) i needed to type SUDO, its an UBUNTU thing apparently, so changed my permissions to 755 (safer than 777) & its saving the file now.

Regards,

Mezo.
Mezo
 
Posts: 7
Joined: 11. February 2014 08:01
Operating System: Linux Mint 16

Re: Error: unable to create tmp file in /opt/lampp/htdocs

Postby Altrea » 19. February 2014 05:42

Commands su and sudo are both Linux standards so both of them should be there.
SU switches to the root console and stays there unless it is closed. Sudo runs only a single command with root permissions
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8293
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Error: unable to create tmp file in /opt/lampp/htdocs

Postby Mezo » 19. February 2014 08:27

You would think so eh, but i have read this before on other problems.

If you read through this tutorial,, http://linuxcommand.org/lc3_lts0090.php

It does say "In some distributions, most notably Ubuntu, an alternate method is used. Rather than using su, these systems employ the sudo command instead"

SU didnt work but SUDO did.

Mezo.
Mezo
 
Posts: 7
Joined: 11. February 2014 08:01
Operating System: Linux Mint 16

Re: Error: unable to create tmp file in /opt/lampp/htdocs

Postby Nobbie » 19. February 2014 13:39

Mezo wrote:SU didnt work but SUDO did.


No, both work. But you dont know the password of root in your distribution, therefore you run "sudo", this asks for your own password (not root's password).

You may simply solve this by running:

Code: Select all
sudo su


(ha!)

And and then run the "passwd" command to enter a new password for root:

Code: Select all
passwd


After you did that, exit the shell, start a new one and simply enter "su" - and then provide the new password you have given above. You still have to learn lots of linux basics... :)
Nobbie
 
Posts: 8772
Joined: 09. March 2008 13:04

Re: Error: unable to create tmp file in /opt/lampp/htdocs

Postby Mezo » 19. February 2014 14:53

Nobbie wrote:You still have to learn lots of linux basics... :)


Lots to learn, ive not even started Nobbie :?

Thanks for helping me out.

Mezo.
Mezo
 
Posts: 7
Joined: 11. February 2014 08:01
Operating System: Linux Mint 16


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 6 guests