Fix: WordPress Temporary Directory on cPanel Server

To fix the WordPress Temporary Directory with wp-config, you can follow these steps:

  • Open the wp-config.php file located in the root directory of your WordPress installation.

  • Find the line that defines the WP_TEMP_DIR constant. It may look like this
define('WP_TEMP_DIR', '/path/to/temp/directory');
  • Replace the path with the absolute path to a directory on your server that is writable by the web server. You can use the ABSPATH constant to specify the path to your WordPress installation directory. For example:
define('WP_TEMP_DIR', ABSPATH . 'wp-content/temp/');
  • This will create a temporary directory inside the wp-content directory of your WordPress installation.
  • Save the changes to the wp-config.php file.

  • Check that the directory you specified has the correct permissions set so that the web server can write to it. You can use the chmod command to set the correct permissions, for example:
chmod -R 755 /path/to/temp/directory

This will set the directory to be readable, writable, and executable by the owner, and readable and executable by everyone else.

Once you have completed these steps, WordPress will use the temporary directory you specified in wp-config.php for temporary files.

---

If the issue is not yet solved with the previously given instructions, try executing the following command to restart the PHP-FPM services:

/scripts/restartsrv_cpanel_php_fpm
/scripts/restartsrv_apache_php_fpm

Run the following commands to create a scheduled cronjob which will execute every 6 hours:

echo '0 */6 * * * root /scripts/restartsrv_cpanel_php_fpm > /dev/null 2>&1
0 */6 * * * root /scripts/restartsrv_apache_php_fpm > /dev/null 2>&1

@reboot root /scripts/restartsrv_cpanel_php_fpm > /dev/null 2>&1
@reboot root /scripts/restartsrv_apache_php_fpm > /dev/null 2>&1' > /etc/cron.d/ReinitPHPFPM

Feel free to contact us, if you need further help!

  • 4 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...