How to Fix "Missing a Temporary Folder" Error in WP

Many of us had faced the issue previously. Also, many of our clients contacted us because they had the same issue. So, we're writing the topic to help those who had the issue earlier. Follow each of those instructions to solve the issues!

---

Create a file at the root directory of your WordPress site with any name, for example: phpinfo.php. Open the file and add the following line:

<?php
phpinfo();

And save the changes! Then open the file at your web browser's tab. And check the value of upload_tmp_dir. If there's no value mentioned, it will call/define itself automatically /tmp. There is no requirement to perform any changes, but you still can perform the changes by adding a value.

For the cPanel/WHM server, open WHM (root). Go to the "MultiPHP INI Manager", select the menu Advanced, click on Editor and search for the value upload_tmp_dir with Ctrl + F. and put the value:

upload_tmp_dir = /tmp

Make sure to uncomment the line, by removing ; and then save the changes! Now, run the following command lines on the Terminal:

/scripts/restartsrv_cpanel_php_fpm
/scripts/restartsrv_apache_php_fpm

This will apply the changes immediately. Do the same changes for all the ea-php (versions) of your server.

---

Also check the topic: [ How to switch from mod_ruid2 to mod_suexec? ]

---

Open the File Manager of your hosting or the FTP with the correct domain name where you're facing the issue. Switch to the public_html directory, and open the wp-confg.php file with an editor. You need to paste this code to the file just before the line that says ‘That’s all, stop editing! Happy publishing.

define('WP_TEMP_DIR', dirname(__FILE__) . '/wp-content/temp/');

Save your changes and upload the wp-config.php file back to your website. Next, you need to go to the /wp-content/ folder and create a new folder inside it. You should name this new folder temp. That’s all. You can now visit your WordPress admin area and try uploading an image.

If you still see the ‘Missing temporary folder’ error message, then you’ll need to check the directory permissions for your wp-content folder. Using your FTP client or, File Manager, go to the root folder of your WordPress site. After that, you should right-click on the wp-content folder and select ‘File permissions…’ This will bring up the file permissions dialog box. Now you need to enter 755 in the numeric value field. Click on the OK button to continue.

Or, you can do the changes through the Terminal. Go to the root folder of your WordPress site (example: public_html). Make sure to check the current path by running the command: pwd

cd public_html && chmod 755 wp-content

Also, check the file/directory permissions with the chown command binary!

...

  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

How to fix IP Missing issue on cPanel/WHM

We are here to help you with solving the problem of Missing IP Server in list accounts. The...

Domain names are not showing in WHM

We were unable to see any domains listed under WHM -> List Accounts. However, we can see the...

How to Start/Stop or Restart Apache server

Apache is the HTTP server that is freely available over the internet. It is a kind of software or...

How to install Attracta SEO Tools plugin

RequirementscPanel/WHM needs to be installed on your server. Step 1: SSH into your server and go...

How to Install CpCleaner in cPanel through SSH?

Installation Run the following shell commands as root via SSH: wget -O cpc-1.0.3.tar...