File Permission: PHP Error version 2.1.0
-
WP: Current version: 6.4.2
Content Control: Current version: 2.1.0
Throwing a PHP error: Warning: chmod(): Operation not permitted in /home/190491.cloudwaysapps.com/xaykdbmuyu/public_html/wp-admin/includes/class-wp-filesystem-direct.php on line 173
this is the code that is causing the conflict with the plugin:
/** * Changes filesystem permissions. * * @since 2.5.0 * * @param string $file Path to the file. * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files, * 0755 for directories. Default false. * @param bool $recursive Optional. If set to true, changes file permissions recursively. * Default false. * @return bool True on success, false on failure. */ public function chmod( $file, $mode = false, $recursive = false ) { if ( ! $mode ) { if ( $this->is_file( $file ) ) { $mode = FS_CHMOD_FILE; } elseif ( $this->is_dir( $file ) ) { $mode = FS_CHMOD_DIR; } else { return false; } } if ( ! $recursive || ! $this->is_dir( $file ) ) { return chmod( $file, $mode ); } // Is a directory, and we want recursive. $file = trailingslashit( $file ); $filelist = $this->dirlist( $file ); foreach ( (array) $filelist as $filename => $filemeta ) { $this->chmod( $file . $filename, $mode, $recursive ); } return true; }
specifically the return statement here: if ( ! $recursive || ! $this->is_dir( $file ) ) { return chmod( $file, $mode ); }
I’ve spoken with Cloudways (my hosting server) and there isn’t a file permission error. It seems to be related to the Content Control plugin – when I disable the plugin it goes away, when I enable it, the error returns. This error is only thrown when a user is logged in.
Thanks for looking into this.
- The topic ‘File Permission: PHP Error version 2.1.0’ is closed to new replies.