PHP Warning: File upload error - unable to create a temporary file

oah

Well-Known Member
Jan 23, 2018
49
8
8
Iraq
cPanel Access Level
Website Owner
Hi

I am getting the following error when uploading images to my website:

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

I am running centos-7 with WHM. the current user for php-7.2 is "oah" with group "oah" although I have the "upload_tmp_dir" set to default which is "/tmp" in centos-7. I added that user to the root group but still have the same error message, do I need to set further permissions? if so, where?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
Hello @oah,

Can you let us know the contents of the .htaccess file in the document root of the affected PHP script? Ensure to remove any identifying information from the contents when pasting it here.

Thank you.
 

oah

Well-Known Member
Jan 23, 2018
49
8
8
Iraq
cPanel Access Level
Website Owner
Hi
Thank you for your support, I solved the problem (temporarily) by adding the user to the root group ( I know that is a security risk ) but for debug purposes doing that solved the problem for me.