1

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

  1. tried 775

  2. 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)?

3
  • "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 edit php.ini? Unless this is your own server, you probably don't have access to php.ini? You would then need to restart your webserver (Apache?).
    – DocRoot
    Commented Oct 23, 2019 at 20:52
  • @DocRoot Yes, that is a typo in my question. In my files I was using the proper character. In regards to the 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).
    – thecosciug
    Commented Oct 24, 2019 at 11:09
  • 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 or php_flag directives) or use a .user.ini file (same syntax as php.ini) in your HTML directory. Reference: php.net/manual/en/configuration.file.per-user.php
    – DocRoot
    Commented Oct 24, 2019 at 13:57

1 Answer 1

2

Well... I fixed it! But as it usually goes, I'm unsure of the exact thing that put it together. However, I will leave what I did over here, in hopes that it might help someone else in the future.

From cPanel, I first changed my php version from 7.2 to 7.1. And it crashed my website. Therefore, I changed it back to 7.2, and voila!

It simply works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.