Title: PHP:  chmod warning
Last modified: August 22, 2016

---

# PHP: chmod warning

 *  [saintron](https://wordpress.org/support/users/saintron/)
 * (@saintron)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/php-chmod-warning/)
 * A colleague has diagnosed this issue and it appears the code is deleting the 
   old file and then trying to set permissions on the old file instead of the new
   file resulting in the warning.
 * The warning says file doesn’t exist when chmod() called on line 125 of upload.
   php.
    The original line is chmod($current_file, $original_file_perms); But it
   looks like it should actually be chmod($new_file, $original_file_perms);
 * hope this helps.
 * [https://wordpress.org/plugins/enable-media-replace/](https://wordpress.org/plugins/enable-media-replace/)

The topic ‘PHP: chmod warning’ is closed to new replies.

 * ![](https://ps.w.org/enable-media-replace/assets/icon-256x256.png?rev=1940728)
 * [Enable Media Replace](https://wordpress.org/plugins/enable-media-replace/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/enable-media-replace/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/enable-media-replace/)
 * [Active Topics](https://wordpress.org/support/plugin/enable-media-replace/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/enable-media-replace/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/enable-media-replace/reviews/)

## Tags

 * [chmod](https://wordpress.org/support/topic-tag/chmod/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * 0 replies
 * 1 participant
 * Last reply from: [saintron](https://wordpress.org/support/users/saintron/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/php-chmod-warning/)
 * Status: not resolved