Page 1 of 1

Can't create/write to file '/tmp

Posted: Fri Dec 31, 2010 1:03 pm
by websterzonline
hello,

i am having this error while opening my store please tell me how to solve it

Error: Can't create/write to file '/tmp/#sql_4a8b_0.MYD' (Errcode: 17)
Error No: 1
SELECT *, pd.name AS name, p.image, m.name AS manufacturer, ss.name AS stock, (SELECT AVG(r.rating) FROM review r WHERE p.product_id = r.product_id GROUP BY r.product_id) AS rating FROM product p LEFT JOIN product_description pd ON (p.product_id = pd.product_id) LEFT JOIN product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN manufacturer m ON (p.manufacturer_id = m.manufacturer_id) LEFT JOIN stock_status ss ON (p.stock_status_id = ss.stock_status_id) WHERE p.status = '1' AND p.date_available <= NOW() AND pd.language_id = '1' AND p2s.store_id = '0' AND ss.language_id = '1' ORDER BY p.date_added DESC LIMIT 3

Re: Please look how to solve this error

Posted: Fri Dec 31, 2010 1:57 pm
by kedgetech
As you might already know its issue with mysql trying to write t a file..

Try two things
1. Check if the files are having enough space usually happens when hosted server tmp space is full .
2. The file/folder you are writing into has permissions to be written or its not changed recently. Usually we see in some of our client applications, hosting companies take it for granted that they are allowed to change the permissions. They call it optimization while we call it a bloody mess :)

Good luck and HNY.

Re: Please look how to solve this error

Posted: Mon Nov 07, 2011 10:35 pm
by olstar
See here: http://www.dijiblog.co.uk/opencart-sess ... edir-full/

Opecart is shipped with 2 x php.ini files that casue the issues.

The the above link to fix it for future reference :)

Re: Please look how to solve this error

Posted: Tue Nov 08, 2011 12:46 am
by i2Paq
Why not just post the solution here?

The (your) \TMP (temp) folder is full because of an issue with the 2x php.ini files.
The temp files are saved to long.

In the \php.ini find:

Code: Select all

session.gc_maxlifetime = 12000000;
This number is in seconds, so in hours that would be; 3,334 – which is 138 days!

Change to:

Code: Select all

session.gc_maxlifetime = 3600;
Wich is just one (1) hour.

In the \admin\php.ini find:

Code: Select all

session.gc_maxlifetime = 12000000;
Change to:

Code: Select all

session.gc_maxlifetime = 10800;
Wich is just three (3) hours.

Re: Can't create/write to file '/tmp

Posted: Tue Nov 08, 2011 2:18 am
by Daniel
permissions issue. nothing to do with opencart. contact your host.

Re: Can't create/write to file '/tmp

Posted: Tue Nov 08, 2011 3:08 am
by Xsecrets
Daniel wrote:permissions issue. nothing to do with opencart. contact your host.
no it's an out of space issue because since the session lifetime is set so high no sessions ever get deleted, so the fix posted is valid.

Re: Can't create/write to file '/tmp

Posted: Tue Nov 08, 2011 2:06 pm
by Daniel
listen carefully!

opencart does not come with a /tmp directory. this is created by your host to store sessions.

contact your host!

Re: Can't create/write to file '/tmp

Posted: Tue Nov 08, 2011 9:30 pm
by Xsecrets
Daniel wrote:listen carefully!

opencart does not come with a /tmp directory. this is created by your host to store sessions.

contact your host!
Daniel you are smart most of the time, then you just act stupid like this. Listen carefully opencart does come with a php.ini which sets the session lifetime to a very long time, so that sessions will not get cleaned up, so the tmp directory that opencart didn't create can get full and piss off shared hosts. Probably one of the reasons you are seeing blowback from hosts like hostgator.

Re: Can't create/write to file '/tmp

Posted: Wed Nov 09, 2011 12:59 am
by olstar
LOL

Accept its a problem CAUSED BY YOUR SHIPPED PHP.INI FILES!!!!!!!!

Love the software and appreciate what you guys have put into it..

But admit when you are wrong already ::)

Re: Can't create/write to file '/tmp

Posted: Wed Nov 09, 2011 1:05 am
by DJB31st
Without this getting out of hand.

Can i ask why the values where set as they are Daniel?

It has caused a number of issues on our server, even with tmpwatch clearing out the /tmp folder nightly on a high traffic site still being enough to topple the server with a full /tmp dir.

As discussed above it appears to have also caused a few issues with hostgator and has been mentioned a number of times in the forum (which always results in the user moving server to resolve the "issue")

Re: Can't create/write to file '/tmp

Posted: Mon Feb 18, 2013 4:10 pm
by Alsaru
I am also bothered by this stupid error "Notice: Error: Can't create/write to file '/tmp". I am not trying to take part on any of you guys and regarding php.ini this has no relevancy in solving this error. I have several developed shops built all on Opencart some are big traffic sites some are low. Only one client presented this error and surprising or not he is hosted on a cheap server. And the server admins just f... him up and take his money. Don't encourage this behavior.

Re: Can't create/write to file '/tmp

Posted: Mon Feb 18, 2013 8:38 pm
by Daniel
setting a session that can last 24 hours is not issue. having a cheap host is.

are you that dumb! what happens if you want to setup a forum with persistent login!

try buying hosting from a decent company that you don;t have to share with 1000 other people.

Re: Can't create/write to file '/tmp

Posted: Mon Feb 18, 2013 9:36 pm
by beipink
I also experienced this same problem with sessions with a not so cheap shared hosting.
My suggestion is to simply stay away from old shared hosts and move on to virtual environment (If this is the correct terminology). Basically, at the same price of classic shared account, you can have your own environment with shared server resources. ie, MySQL, FTP Sessions etc etc will run within your account and are not in shared folders.

Re: Can't create/write to file '/tmp

Posted: Mon Feb 18, 2013 10:50 pm
by Daniel
also some one on the server must be doing a lot of traffic for the file system to producing errors like that.