Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter rahvee

    (@rahvee)

    When you see the “missing a temporary folder” error, it just means wordpress was unable to write to the temp folder – either because it’s not defined, or because the user nginx or apache httpd runs as doesn’t have write permission in the target directory.

    The problem could be permission bits (you can try chown or chmod on the target directory) or selinux or apparmor.

    First, figure out what directory the system is trying to use (described below), and then check what user the web server is running as, and check the permissions on the target directory. If permissions look good, consider if selinux is enforcing by running (as root or sudo) sestatus and if it’s enforcing, you might have to change the target directory’s selinux context. If you’re on a debian/ubuntu variant of linux, you might have apparmor running. I don’t know how to check status on that one; you’ll have to google it or something.

    If you want to confirm which directory your wordpress is using for temp, there might be an easier way than this, but I was able to edit wp-includes/functions.php, find the function get_temp_dir(), and everywhere it says “return” stick a line just above it to display what’s getting returned. You can use error_log(), or echo, or print.

    Thread Starter rahvee

    (@rahvee)

    If you define('WP_TEMP_DIR', dirname(__FILE__) . '/wp-content/temp/'); in the wp-config.php file, then it should take effect in get_temp_dir() function in wp-includes/functions.php.

    Sometimes you might need to do this, to specify a custom temp dir, to resolve the Missing a temporary folder error message.

    In previous posts on this forum, found by googling and using the search function on this forum to find the Missing a temporary folder error message, people have pasted the define line, using unicode quote-like characters, instead of the actual ASCII single quote characters. This is almost indistinguishable to a human reading the code (depending on your font), but the end result if you paste the wrong quote type into your wp-config.php file is WP_TEMP_DIR has no effect.

Viewing 2 replies - 1 through 2 (of 2 total)