Server admin delete empty /tmp now all php script giving "File upload error - unable to create a temporary file in Unknown on line 0" error

TechBill

Member
Aug 7, 2011
15
1
51
I am getting complaints about websites php script not allowing file upload and php mail not working so I look in error log on each domain (all on same host) and it all show this error message

File upload error - unable to create a temporary file in Unknown on line 0

I contacted the WHM admin of that host and he said only thing he did was empty out the /tmp folder yesterday ... Did this task break all my customer php scripting related to uploading file using php or sending email using php?

How do I fix this?

Thank you
Bill
 

andrew.n

Well-Known Member
Jun 9, 2020
607
171
43
EU
cPanel Access Level
Root Administrator
erm...how did he empty out the /tmp folder? Did he really empty it out or rather removed /tmp then created it again with the wrong permissions? Sounds like a permission issue for me.
 
  • Like
Reactions: cPanelLauren

TechBill

Member
Aug 7, 2011
15
1
51
erm...how did he empty out the /tmp folder? Did he really empty it out or rather removed /tmp then created it again with the wrong permissions? Sounds like a permission issue for me.
I wish I knew what he did ... In the email, he said he cleaned out the old stuffs in /tmp yesterday but he didn't say how he cleaned it out if he used rm * or what did he do to clean it out.
 

TechBill

Member
Aug 7, 2011
15
1
51
I just know all my customer php script was working fine before yesterday and today it's all not working .. and this what we get in error log when I google it pointed to something about /tmp folder. When I mentioned it to the admin, he was like oh yeah I cleaned out the /tmp yesterday because it was almost full etc. in his email
 

TechBill

Member
Aug 7, 2011
15
1
51
I look in one of my other host where I am the server administrator of. We uses WHM and Cpanel on that server so. I checked to see if there anything in the /tmp file. I noticed a lot of folder with "php-fpm" in it.

Would deleting those php-fpm folders in /tmp break all the php and javascript on website?

Look like there is one /tmp*php-fpm*/ folder for each website on the server created so I am wondering on that server where all website php isn't working because the server admin cleaned out all those php-fpm folders?

Should it be re-created automatically since it in a /tmp folder when called in php script?


Screen Shot 2020-08-25 at 1.27.53 PM.jpg
 

andrew.n

Well-Known Member
Jun 9, 2020
607
171
43
EU
cPanel Access Level
Root Administrator
Do you have root access to the server? What does "ls -l /" shows? What are the permissions of the /tmp folder?
 

TechBill

Member
Aug 7, 2011
15
1
51
Not on the server where admin emptied the /tmp folder .. I wish I did... Still waiting to hear back from server admin
 

TechBill

Member
Aug 7, 2011
15
1
51
This is from my WHM/Cpanel CentOS7 which I know is working :P

drwxrwxrwt. 86 root root 8192 Aug 25 15:06 tmp
 

PenguinInternet

Well-Known Member
PartnerNOC
Jun 20, 2007
191
23
68
Cardiff, UK
cPanel Access Level
DataCenter Provider
Twitter
The issue is almost certainly that the various php-fpm.service directories have been deleted - restart the FPM service (/scripts/restartsrv_apache_php_fpm) and they will be recreated and resolve this.

We found this out the hard way a while ago when tmpwatch was deleting them so added an exclusion for those.
 
  • Like
Reactions: andrew.n

TechBill

Member
Aug 7, 2011
15
1
51
The issue is almost certainly that the various php-fpm.service directories have been deleted - restart the FPM service (/scripts/restartsrv_apache_php_fpm) and they will be recreated and resolve this.

We found this out the hard way a while ago when tmpwatch was deleting them so added an exclusion for those.

MANY THANK YOU !!!!!!!!!

That fixes it ....

Have a great day!!
 
  • Like
Reactions: cPanelLauren