This error might have occured on WordPress for you: “Image has failed to upload due to an error – Missing a temporary folder”.
- It may be a permission issue for the php temporary folder
- The php temp folder may not exist.
- Find the php.ini file for your webhost.
- Locate the temp folder
- Create the temp folder if it does not exist
- Give it proper permissions
In my case, I had transferred my site transhost, and hence this folder was actually missing.
My php.ini file (generated by i-mscp) was at this location: /var/www/fcgi/mysite/php5/php.ini
Once php.ini file was located, I needed to find the temp folder used by php:
#grep -in 'upload_tmp_dir' /var/www/fcgi/mydomain/php5/php.ini 875:upload_tmp_dir = "/var/www/virtual/mydomain//phptmp/"
Since this folder was missing, I created it and provided proper permissions and then restarted apache2:
#mkdir "/var/www/virtual/joel.co.in/phptmp/" #chmod 755 "/var/www/virtual/joel.co.in/phptmp/" #chown -R vu2003.www-data "/var/www/virtual/joel.co.in/phptmp/" #service apache2 restart
Now, I could upload media files again.
Joel G Mathew, known in tech circles by the pseudonym Droidzone, is an opensource and programming enthusiast.
His favorite pastime is grappling with GNU compilers, discovering newer Linux secrets, writing scripts, hacking roms, and programs (nothing illegal), reading, blogging. and testing out the latest gadgets.
When away from the tech world, Dr Joel G. Mathew is a practising ENT Surgeon, busy with surgeries and clinical practise.