php - Wordpress media upload error "Missing a temporary folder" on a local server

I am currently developping a WordPress website locally since I have much work to do before getting it uploaded. For local hosting purpose, I am using Local by Flywheel. As I wanted to start testing pages layout, I tried to upload some media in the classic WP Media Uploader but I continuously get the error "XXXX has failed to upload: Missing a temporary folder.".

I've looked for the answer on the Internet and did found the "edit the wp-config.php technique" that's seems to be the only answer to this problem, but actually it does not work for me. Here's a view of the 'custom side' my wp-config file: `

/* Add any custom values between this line and the "stop editing" line. */

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

/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
    define( 'ABSPATH', __DIR__ . '/' );
}

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';

A call of var_dump(get_temp_dir()) returns this:

[abs path]\app\public\wp-content\temp/'

Which seems to tell that the wp-config.php works correctly.

Often, online tutorials also say to set permission 755 on the "temp" folder, but since this folder is not on a remote server accessed via FTP, it does not seems that I can set that. I also read to edit my "php.ini" file but I do not have this file in my local site folders.

Does someone knows what I should do ?

Answer

Solution:

Ok so even though I searched through google and StackOverflow during 2 or 3 days, I just found the solution on another forum, the post was quite discreet...

So to anyone who may have the same problem as me: Apparently this error is encountered on flywheel when you use an Apache web server instead of a nginx one. If you change to this last one in your Local config the error shouldn't show up anymore. On the forum where I found this solution, the guy said that using nginx istead of Apache was a good thing because it is also faster.

Source