• Hi

    I propose to fix the warning/error

    PHP Warning: mkdir() [function.mkdir]: Permission denied in …/wp-content/plugins/wp-csv/wp-csv.php on line 323

    due to unsuccessful mkdir.
    solution is to check if parent folder is writable
    file wp-csv around line 323
    before :

    public function get_csv_folder( ) {
                            $chosen_folder = '';
                            $paths = $this->get_paths( 'wpcsv_backups' );
                            foreach( $paths as $p ) {
                                    if ( ( !file_exists( $p ) && ( mkdir( $p, 0755 ) ) || $this->folder_writable( $p ) ) ) {
                                            $chosen_folder = $p;
                                            break;
                                    }
                            }

    after :

    public function get_csv_folder( ) {
                            $chosen_folder = '';
                            $paths = $this->get_paths( 'wpcsv_backups' );
                            foreach( $paths as $p ) {
                                    if ( ( !file_exists( $p ) && ($this->folder_writable(dirname($p))) && ( mkdir( $p, 0755 ) ) || $this->folder_writable( $p ) ) ) {
                                            $chosen_folder = $p;
                                            break;
                                    }
                            }

    (should I open a ‘trac’ ?)
    thanks for wp-csv plugin

    https://www.ads-software.com/plugins/wp-csv/

  • The topic ‘mkdir Permission denied in wp-csv.php on line 323 (resolved)’ is closed to new replies.