Today I pushed to live (using Softaculous) a staged version of my WordPress website which was working perfectly. Afterwards, the only thing that doesn't work properly is uploading files/media.
The error I get is "Missing a temporary folder."
Now, I made good use of the internet and went on quite a lot of websites which detailed a few steps to fixing this, but to no success. Whatever I do, the error persists.
The "fixes" i tried so far are as follows:
a. Define temp folder in wp-config.php
1.
define(‘WP_TEMP_DIR’, ‘/wp-content/temp/’);
2.
define(‘WP_TEMP_DIR’, dirname(__FILE__) . ‘/wp-content/temp/’);
3.
define('WP_TEMP_DIR',ABSPATH.'/temp/');
b. Define temp folder in the php.ini file
1.upload_tmp_dir= ABSPATH.'/temp/'
2.upload_tmp_dir= /home/user/public_html/temp/
c. Change folder permission from the default 755
tried 775
tried 777
I also checked the functions.php file for the function to make sure nothing is broken, but it is all fine as far as I can tell and can't find a reason why it doesn't execute as it should.
What other methods should I try without having to reinstall the whole website (for obvious reasons)?
define(‘WP_TEMP_DIR’, ‘/wp-content/temp/’);
" - You are using curly quotes here - presumably that is just a "typo" in your question? Where were you able to editphp.ini
? Unless this is your own server, you probably don't have access tophp.ini
? You would then need to restart your webserver (Apache?).php.ini
file, I was editing it in the public_html folder. For safe measure I also dropped a copy of the file in the wp-admin folder (though I think it is useless, but I was close to desperate).php.ini
is not ordinarily a per-directory config file that's permitted in user-space, unless your host has specifically enabled this. To change local config options you need to either use.htaccess
(ie.php_value
orphp_flag
directives) or use a.user.ini
file (same syntax asphp.ini
) in your HTML directory. Reference: php.net/manual/en/configuration.file.per-user.php