WordPress plugin installation failed – Could not create directory

Home Forums BulletProof Security Pro WordPress plugin installation failed – Could not create directory

Tagged: , ,

This topic contains 31 replies, has 2 voices, and was last updated by  AITpro Admin 3 years, 3 months ago.

Viewing 15 posts - 1 through 15 (of 32 total)
  • Author
    Posts
  • #21560

    reborn
    Participant

    After installing BPS pro, I am unable to install new plugins.

    What I get is

    Unpacking the package…

    Could not create directory.

    Please advise, thanks.

    #21562

    AITpro Admin
    Keymaster

    There is not anything in BPS Pro that would prevent plugin installations so I assume the problem is that you have a DSO Server type and the WP Filesystem API Method needs to be changed to direct or you have a folder permission or folder Ownership problem.

    If you have a DSO Server type go to the BPS System Info page and post this information:
    WP Filesystem API Method:

    If you do not have a DSO Server type and have a CGI Server type then post your File|Folder Permissions (CGI or DSO)|Script Owner User ID (UID)|File Owner User ID information that you see on the BPS System Info page. DO NOT post your actual UID. Just use x or 0 in place of your actual UID.

    #21566

    reborn
    Participant

    Wow, thats a quick response.

    Here is the info:

    WP Filesystem API Method: direct
    Server API: apache2handler DSO Host Server Type

    I had changed it to direct when installing BPS pro using your instructions on the config file.

    #21568

    reborn
    Participant

    Before installing BPS, i did not encounter the unable to write directory issue.

    #21569

    AITpro Admin
    Keymaster

    Normally changing the WP Filesystem API Method to direct will fix any/all issues with plugin installations failing.  Ok now check the File|Folder Permissions (CGI or DSO)|Script Owner User ID (UID)|File Owner User ID information.  Are the Script Owner User ID (UID) and File Owner User ID the same for all of your WordPress folders?  What are the folder permissions for the /wp-content folder and the /plugins folder.

    Another thing that can cause the “Could not create directory” error would be if you are out of available disk space/quota.  ie no more disk space left to install anything else.

    #21571

    reborn
    Participant
    File Path Folder Path Recommended Permissions Current Permissions Script Owner User ID (UID) File Owner User ID
    ../ 755 0750 570 570
    ../.htaccess 644 0666 570 570
    ../wp-config.php 644 0644 570 570
    ../index.php 644 0644 570 570
    ../wp-blog-header.php 644 0644 570 570
    ../wp-admin 755 0755 570 570
    ../wp-includes 755 0755 570 570
    ../wp-content 755 0777 570 570
    ../wp-content/plugins 755 0755 570 570
    ../wp-content/themes 755 0755 570 570
    ../wp-content/uploads 755 0777 99 99
    ../wp-content/upgrade 755 0755 570 570
    ../wp-content/bps-backup 755 0755 99 99
    ../wp-content/bps-backup/autorestore 755 0755 99 99
    ../wp-content/bps-backup/logs 755 0755 99 99
    ../wp-content/bps-backup/master-backups 755 0755 99 99
    ../wp-content/bps-backup/quarantine 755 0755 99 99
    ../wp-content/bps-backup/backups_xxxxxxxxxxxxx 755 0755 99 99
    #21576

    AITpro Admin
    Keymaster

    Ok try changing the folder permissions for the /wp-content folder from 777 to 755 and try to install a plugin.

    #21580

    reborn
    Participant

    I changed the folder permissions for the /wp-content folder from 777 to 755, but still same issue.

    #21581

    AITpro Admin
    Keymaster

    hmm ok change the folder permissions back to 777 and edit your wp-config.php file and comment out this code below and then try to install a plugin.  This is just for testing purposes to eliminate this as the cause.  Ideally you want to use the “direct” Filesystem Method since it is normally the optimum choice to use to allow WordPress to control plugin installations and other things dealing with files and file permissions.  If it turns out that this code below does not work on your server then that is going to probably mean BPS Pro will not be compatible with your server until changes are to made to the server config or folders to allow the “direct” Filesystem Method to work normally/correctly.  I do not want to jump to far ahead so first just see if this code below has anything to do with the problem.

    define( 'FS_METHOD', 'direct' );
    define( 'FS_CHMOD_DIR', ( 0755 & ~ umask() ) );
    define( 'FS_CHMOD_FILE', ( 0644 & ~ umask() ) );
    #21582

    reborn
    Participant

    ok, I commented that out in config file and now installing plugin works.
    What I noticed as well is that with that code in config file, by clicking install plugin, it goes straight to downloading and attempting to create directory.
    Without that code, when I click on install plugin, it goes to a intermediate step where it shows my ftp credentials and i need to click ‘proceed’

    #21583

    AITpro Admin
    Keymaster

    Yep that is exactly what I was afraid of.  You will notice now on the BPS System Info page that your WP Filesystem API Method is ftpext, which is very problematic not only for BPS, but for everything in WordPress.  It may be that the server configuration has been done in a way that will still allow BPS Pro to function normally, but maybe not.  What you need to check is if AutoRestore|Quarantine is actually working correctly or not now.  Turn on AutoRestore if it is not turned on already and upload a text file to your website root folder.  Allow the AutoRestore Cron to run, next scheduled run time and see if the file is quarantined or not.  It is going to be a 50/50 chance and will depend on if your server is configured in a way that will work with BPS Pro.

    #21584

    reborn
    Participant

    yes, i uploaded 2 files and  they are quarantined.

    #21586

    reborn
    Participant

    However, the qurantine keeps repeating the same files.  So every minute, i get the same file quarantined, and the list gets longer with the same file.

    #21588

    AITpro Admin
    Keymaster

    Cool!  Ok then what that means is whoever configured your server did it in a way that BPS Pro and everything else should work fine.  Setting up ftpext to work correctly on a DSO server type requires a high level of knowledge and expertise so I would say that you are in good hands with your host. 😉  Normally it goes the other 50% way in this particular scenario.

    #21589

    AITpro Admin
    Keymaster

    Maybe I spoke to soon then.  Were the files actually really sent to quarantine?  Do you still see them in the folder where you uploaded them too?  Go to Quarantine and delete the files.

Viewing 15 posts - 1 through 15 (of 32 total)

You must be logged in to reply to this topic.