Support » Fixing WordPress » Installation failed: Could not create directory.

  • Resolved snehalvolvoikar29

    (@snehalvolvoikar29)


    I have installed wordpress on my linux server. I just started with instaaling a new theme for my website. But I cannot proceed with that as I have following error “Installation failed: Could not create directory.” on my wordpress admin dashboard.

    Is this a problem with my file/folder permissions?

    Please help me with this.

    Currently I have below permissions set to all my folders for wordpress:

    -rw-r-xr– 1 root root 420 Nov 30 2017 index.php
    -rw-r-xr– 1 root root 19935 Jan 1 2019 license.txt
    -rw-r-xr– 1 root root 7368 Sep 2 21:44 readme.html
    -rw-r-xr– 1 root root 6939 Sep 3 00:41 wp-activate.php
    drwxr-xr-x 9 root root 4096 Dec 18 22:16 wp-admin
    -rw-r-xr– 1 root root 369 Nov 30 2017 wp-blog-header.php
    -rw-r-xr– 1 root root 2283 Jan 21 2019 wp-comments-post.php
    -rw-rwxrw- 1 apache apache 3248 Dec 28 06:16 wp-config.php
    -rw-r-xr– 1 root root 2898 Jan 8 2019 wp-config-sample.php
    drwxr-xr-x 4 root root 4096 Dec 28 06:23 wp-content
    -rw-r-xr– 1 root root 3955 Oct 10 22:52 wp-cron.php
    drwxr-xr-x 20 root root 12288 Dec 18 22:16 wp-includes
    -rw-r-xr– 1 root root 2504 Sep 3 00:41 wp-links-opml.php
    -rw-r-xr– 1 root root 3326 Sep 3 00:41 wp-load.php
    -rw-r-xr– 1 root root 47597 Dec 9 13:30 wp-login.php
    -rw-r-xr– 1 root root 8483 Sep 3 00:41 wp-mail.php
    -rw-r-xr– 1 root root 19120 Oct 15 15:37 wp-settings.php
    -rw-r-xr– 1 root root 31112 Sep 3 00:41 wp-signup.php
    -rw-r-xr– 1 root root 4764 Nov 30 2017 wp-trackback.php
    -rw-r-xr– 1 root root 3150 Jul 1 08:01 xmlrpc.php

Viewing 3 replies - 1 through 3 (of 3 total)
  • sandernik

    (@sandernik)

    Hi,
    It looks like you don’t have permission to write to the directory that WordPress is intending to create the theme directory in. It’s recommended to set the following file permissions:

    755 for all folders and sub-folders.
    644 for all files.

    Hence, make sure that you change folders and file permissions “recursively” to 755 and 644 respectively as it might happen that you have certain permissions for the main folder but the subfolders have different permissions.

    Dion

    (@diondesigns)

    Your main problem isn’t permissions, it’s that the WP filesystem is owned by the root user. All WP files/directories should be owned by the user PHP is running under, which appears to be apache. Log in as root and issue the following commands:

    cd /path/to/above/wp/directory
    chown -R apache: *
    chmod -R o-x *
    chmod -R o-w *

    Change /path/to/above/wp/directory accordingly. If you can’t log in as root, you’ll need to prepend sudo to the chown and chmod commands. This should fix the main problem. (The chmod commands aren’t required; they fix security issues caused by your installing files as root.

    Please be aware that anytime you add files manually to your WP filesystem when logged in as root, you must run the above commands afterwards to insure the files have the correct ownership. This issue can be fixed by installing and configuring PHP-FPM; your hosting company or server administrator can do this for you.

    snehalvolvoikar29

    (@snehalvolvoikar29)

    resolved

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.