• Hi there.

    I am getting this warning in my error log files:

    
    # tail -f /var/log/apache2/error.log
    [Mon Jul 09 16:03:05.589215 2018] [:error] [pid 29445] [client 189.69.142.35:44662] PHP Warning:  stat(): stat failed for gs://uploads.example.com/1/2015/11 in /var/www/wordpress/wp-includes/class-wp-image-editor-gd.php on line 407, referer: https://www.example.com/wp-admin/tools.php?page=regenerate-thumbnails
    

    This is the code block around this error:

    
    // Set correct file permissions
    $stat = stat( dirname( $filename ) );
    $perms = $stat['mode'] & 0000666; //same permissions as parent folder, strip off the executables bits
    @ chmod( $filename, $perms );
    

    I am using:

    1. Debian GNU/Linux 9.4 (stretch)
    2. WordPress 4.9.7
    3. gcs 0.1.3
    4. regenerate-thumbnails 3.0.2

    Step to reproduce:

    1. Create WordPress on a Google Cloud Compute Engine instance using Debian 9
    2. Install required packages (apache2, php, php-mysql, php-gd, php-curl, php-mbstring)
    3. Install WP CLI
    4. Download, configure and install WordPress using the WP CLI
    5. Install the gcs plugin
    6. Install the regenerate-thumbnails plugin
    7. Start a full thumbnails regeneration
    8. Checkout the error logs

    I am not sure this is a gcs plugin error, as the warning is issued within a specific WordPress site, as this files is trying to execute something like this:

    
    $stat = stat( dirname( 'gs://uploads.example.com/1/2015/7' ) ); 
    

    Which might not be a valid file wrapper within PHP.

    Any thoughts might be helpful.

    Thank you.

  • The topic ‘Getting this PHP warning: stat(): stat failed’ is closed to new replies.