Well, I updated W3TotalCache plugin from version 0.9.4.1 to 0.9.5 and ended up with an error “failed to open stream: No such file or directory. PHP Fatal error: require(): Failed opening required” while uploading media in WordPress.
Here’s the complete error message in Apache error log.
PHP Warning: require(home/user/wp-content/plugins/w3-total-cache/.php): failed to open stream: No such file or directory in /home/user/wp-content/plugins/w3-total-cache/w3-total-cache-api.php on line 161, referer: https://site.com/wp-admin/post-new.php [error] PHP Fatal error: require(): Failed opening required 'home/user/wp-content/plugins/w3-total-cache/.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/user/wp-content/pluginsplugins/w3-total-cache/w3-total-cache-api.php on line 161, referer: https://site.com/wp-admin/post-new.php
And here’s the snapshot of error while uploading media:
Unable to upload media after updating W3TotalCache plugin:
After Googling for a while, I understood that the issue was faced by many WordPress users and this reference claims to solve the issue. But wait, even though few users responded saying that the solution worked for them, it actually didn’t work for me (after modifying the suggested code, the Admin page went blank). So finally, I decided to downgrade W3TotalCache plugin to the older version – which is 0.9.4.1 and the media upload worked.
So if you have updated to 0.9.5 version, then quickly downgrade to 0.9.4.1 and those who haven’t updated, please wait until the W3TotalCache team fixes the issue.