Title: Getting this PHP warning: stat(): stat failed
Last modified: July 9, 2018

---

# Getting this PHP warning: stat(): stat failed

 *  [brunitto](https://wordpress.org/support/users/brunitto/)
 * (@brunitto)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/getting-this-php-warning-stat-stat-failed/)
 * 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: http://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.

 * ![](https://ps.w.org/gcs/assets/icon-256x256.png?rev=1604875)
 * [Google Cloud Storage plugin](https://wordpress.org/plugins/gcs/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gcs/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gcs/)
 * [Active Topics](https://wordpress.org/support/plugin/gcs/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gcs/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gcs/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [brunitto](https://wordpress.org/support/users/brunitto/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/getting-this-php-warning-stat-stat-failed/)
 * Status: not resolved