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 ?
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.
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.
PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
https://www.php.net/
Welcome to the Q&A site for web developers. Here you can ask a question about the problem you are facing and get answers from other experts. We have created a user-friendly interface so that you can quickly and free of charge ask a question about a web programming problem. We also invite other experts to join our community and help other members who ask questions. In addition, you can use our search for questions with a solution.
Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.
Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.