skip to Main Content

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:

  1. Restarting WAMP server.
  2. Upgrading my PHP version.
  3. Using a different theme.
  4. 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


  1. Chosen as BEST ANSWER

    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.

    <?php
    /**
     * Plugin Name: Multisite Cache Bug 
     * Description: A potential fix for the problem mentioned at https://wordpress.org/support/topic/iis-wordpress-5-6-multi-sites-file-upload-hang/#post-13867460
     * Version: 0.1
     * License: GPL2
     */
    
    // Prevent direct access to this file
    defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
    
    add_filter( "transient_dirsize_cache", function() {return; } );
    

  2. You need to change that configuration in the php.ini:

    max_execution_time = 1200
    

    or,

    left click on wampmanager icon -> PHP -> PHP Settings
    

    and find max_execution_time configuration

    Login or Signup to reply.
  3. 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

    enter image description here

    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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search