Support » Everything else WordPress » WP-CLI show me “Warning: Could not create directory.”

  • Resolved hack3rcon

    (@hack3rcon)


    Hello,
    I used below command to update WordPress plug-ins:
    # /usr/local/bin/wp plugin update --all --path=/var/www/wordpress
    But it show me below error:

    Warning: chmod() has been disabled for security reasons in /var/www/wordpress/wp-admin/includes/class-wp-filesystem-direct.php on line 173
    https://downloads.wordpress.org/plugin/fv-wordpress-flowplayer.zip...
    Using cached file '/root/.wp-cli/cache/plugin/fv-wordpress-flowplayer-7.4.40.727.zip'...
    Warning: Could not create directory.
     https://downloads.wordpress.org/plugin/recent-posts-widget-extended.1.0.0.zip...
    Using cached file '/root/.wp-cli/cache/plugin/recent-posts-widget-extended-1.0.0.zip'...
    Warning: Could not create directory.
    https://downloads.wordpress.org/plugin/w3-total-cache.2.1.1.zip...
    Using cached file '/root/.wp-cli/cache/plugin/w3-total-cache-2.1.1.zip'...
    Warning: Could not create directory.
    Error: No plugins updated.
    +------------------------------+-------------+-------------+--------+
    | name                         | old_version | new_version | status |
    +------------------------------+-------------+-------------+--------+
    | fv-wordpress-flowplayer      | 7.4.39.727  | 7.4.40.727  | Error  |
    | recent-posts-widget-extended | 0.9.9.7     | 1.0.0       | Error  |
    | w3-total-cache               | 2.1.0       | 2.1.1       | Error  |
    +------------------------------+-------------+-------------+--------+
    

    I opened “wp-config.php” file and added below line to it:
    define('FS_METHOD','direct');
    But problem not solved.
    How can I solve it?

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter hack3rcon

    (@hack3rcon)

    Hello,
    I changed some PHP configuration as below:

    allow_url_fopen         = Off
    allow_url_include       = Off
    variables_order         = "GPCS"
    allow_webdav_methods    = Off
    session.gc_maxlifetime  = 600
    file_uploads            = On
    upload_tmp_dir          = /tmp/
    upload_max_filesize     = 2M
    max_file_uploads        = 2
    enable_dl               = Off
    disable_functions       = system, exec, shell_exec, passthru, phpinfo, show_source, highlight_file, popen, proc_open, fopen_with_path, dbmopen, dbase_open, putenv, move_uploaded_file, chdir, mkdir, rmdir, chmod, rename, filepro, filepro_rowcount, filepro_retrieve, posix_mkfifo
    # see also: http://ir.php.net/features.safe-mode
    disable_classes         =
    session.name                     = myPHPSESSID
    session.auto_start               = Off
    session.use_trans_sid            = 0
    session.cookie_domain            = full.qualified.domain.name
    session.use_strict_mode          = 1
    session.use_cookies              = 1
    session.use_only_cookies         = 1
    session.cookie_lifetime          = 14400
    session.cookie_secure            = 1
    session.cookie_httponly          = 1
    session.cookie_samesite          = Strict
    session.cache_expire             = 30
    session.sid_length               = 256
    session.sid_bits_per_character   = 6
    memory_limit            = 50M
    post_max_size           = 20M
    max_execution_time      = 60
    report_memleaks         = On
    track_errors            = Off
    html_errors             = Off

    Is it related to these changes?

    Thank you.

    Thread Starter hack3rcon

    (@hack3rcon)

    I found the solution. It was because of “chmode()” and “mkdir” in the disable_functions in the “php.ini” file.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP-CLI show me “Warning: Could not create directory.”’ is closed to new replies.