This is a recent issue that is causing a headache.
Each time I try to upload a photo via media upload, I am met with the upload bar reading 100%… a stall, and then an error stating:
Maximum execution time of 120 seconds exceeded
The file could be tiny or big – it won’t even upload a 10kb file.
My WP debug log states the following:
[05-Sep-2021 16:07:56 UTC] PHP Fatal error: Maximum execution time of 120 seconds exceeded in C:wamp64wwwsnswp-includesfunctions.php on line 8051
[05-Sep-2021 16:07:56 UTC] PHP Stack trace:
[05-Sep-2021 16:07:56 UTC] PHP 1. {main}() C:wamp64wwwsnswp-adminasync-upload.php:0
[05-Sep-2021 16:07:56 UTC] PHP 2. wp_ajax_upload_attachment() C:wamp64wwwsnswp-adminasync-upload.php:33
[05-Sep-2021 16:07:56 UTC] PHP 3. media_handle_upload() C:wamp64wwwsnswp-adminincludesajax-actions.php:2549
[05-Sep-2021 16:07:56 UTC] PHP 4. wp_handle_upload() C:wamp64wwwsnswp-adminincludesmedia.php:303
[05-Sep-2021 16:07:56 UTC] PHP 5. _wp_handle_upload() C:wamp64wwwsnswp-adminincludesfile.php:1037
[05-Sep-2021 16:07:56 UTC] PHP 6. clean_dirsize_cache() C:wamp64wwwsnswp-adminincludesfile.php:981
What I have tried:
- Restarting WAMP server.
- Upgrading my PHP version.
- Using a different theme.
- Deactivating all plugins.
One thing that may be the cause (and the only other thing I can think of), is that I recently installed and setup Homestead & Vagrant in order to create an environment to start developing using Laravel.
Could this have anything to do with it? If so, where do I start?
3
Answers
In case anyone else runs into this VERY unique issue...
The issue lied in the fact my site is a multi-site install. Apparently there is a cache bug that triggers this issue.
Source: Where I found people with similar issue.
Within that link someone had posted the following code, which can be installed as a plugin. Ultimately, it fixed my issue. Hope this helps someone until Wordpress fixes the bug.
You need to change that configuration in the php.ini:
or,
and find max_execution_time configuration
That limit is part of the PHP.INI file.
WAMPServer has made that a bit easier to change, and can be done from the wampmanager menu in the system tray
Left click the wampmanager icon -> PHP -> PHP Settings ->
Max Execution Time
Then pick a larger number from the dropdown. Wait a few seconds and wampserver will restart Apache and the new Max Execution Time will be set