Forums

Theme & Plugin Install Failure - Unable to locate WordPress Content directory (27 posts)

  1. eitsadmin
    Member
    Posted 1 year ago #

    First off let me set a few things straight:

    1. Although I can manually install plugins and themes. I will not.
    2. I am attempting to get a complete solution to this problem.
    3. I will grant you access to the actual account so you can look for yourself.
    4. I will post whatever details are required.
    5. I will respond to each suggestion by implementing the proposed solution recording the outcome and then reversing the change if it is not successful

    Installation:
    OS: CentOS 5 (Amazon EC2)

    FTP Access:
    server: http://ftp.enterpriseit.us
    user: testdomain1.com
    pass: (contact me for password)

    Group Membership
    | Group | Members |
    | testdomain1.com | apache, testdomain1.com, root |

    ------------------------------------------
    | Owner & Group |
    ------------------------------------------
    | Path | Owner | Group |
    ------------------------------------------
    | / | testdomain1.com | testdomain1.com |
    ------------------------------------------
    (All directories under / have same owner and group)

    ------------------------------------------------------
    | Permissions |
    ------------------------------------------------------
    | Path | Permission | Permission Octal |
    ------------------------------------------------------
    | / | drwxrwxr-x | 0775 |
    | /*.* | -rw-r--r-- | 0644 |
    | /wp-content/ | drwxr-xr-x | 0755 |
    | /wp-content/*.* | -rw-r--r-- | 0644 |
    | /wp-content/plugins/ | drwxr-xr-x | 0755 |
    | /wp-content/themes/ | drwxr-xr-x | 0755 |
    ------------------------------------------------------

  2. Is "Unable to locate WordPress Content directory" the full and complete error?

    Also is bitnami involved?

  3. eitsadmin
    Member
    Posted 1 year ago #

    @Ipstenu
    Yes that is the full and complete error shown on the UI.

    No bitnami is not involved.

  4. Have you tried making plugins and themes folder 777 instead of 755? Some hosts are techy.

  5. eitsadmin
    Member
    Posted 1 year ago #

    I have done the following:
    chmod 0777 /wp-content/plugins/
    chmod 0777 /wp-content/themes/

    No change in behavior. I receive the same error.

    I have reverted these changes.

  6. Are you able to upload IMAGES and media files via the post editor?

  7. eitsadmin
    Member
    Posted 1 year ago #

    No I was not able to upload images.

    I did the following:

    chmod 0775 /wp-content

    Now I am able to upload images with no problem. However I still have the same error when trying to install plugins.

    I did the following

    chmod 0775 /wp-content/plugins
    chmod 0775 /wp-content/themes

    This did not resolve the issue with plugins and themes. I reverted the second set of changes.

  8. Okay, this is progress actually :D

    What's the permissions on wp-content/upgrade?

  9. eitsadmin
    Member
    Posted 1 year ago #

    Sorry for the delay. Busy day today...

    Note testdomain1.com has become testdomain3.com. this is because i have updated my initiation scripts and rerun them to create a new domain. The current state is post initiation script.

    Image upload - SUCCESS
    Plugin install - FAIL: Unable to locate WordPress Content Dir...
    Theme install - FAIL: Unable to locate WordPress Content Dir...

    Permissions:
    drwxrwsr-x 4 testdomain3.com testdomain3.com.g /wp-content
    drwxrwxr-x 3 testdomain3.com testdomain3.com.g /wp-content/plugins
    drwxrwxr-x 3 testdomain3.com testdomain3.com.g /wp-content/themes
    drwxrwsr-x 3 apache testdomain3.com.g /wp-content/uploads

  10. eitsadmin
    Member
    Posted 1 year ago #

    Oh... and there is no upgrade folder. :)

  11. Okay :) MAKE an upgrade folder and set it to 755 perms please :)

    Also, you may want to define your wp-content directory in your wp-config.php file:
    define('FTP_CONTENT_DIR', '/path/to/wordpress/wp-content/');

    See if that helps.

  12. eitsadmin
    Member
    Posted 1 year ago #

    I did the following:

    sudo mkdir upgrade
    sudo chmod -R 775 upgrade
    sudo chmod g+s upgrade

    I reran a plugin install and it failed with the same error.
    I reverted this change by doing the following:

    sudo rm -Rf upgrade

  13. eitsadmin
    Member
    Posted 1 year ago #

    Did some research. At this link Editing_wp-config.php I found in the "WordPress Upgrade Constants" section the ftp contstants. I added the following to my wp-config.php:

    //* FTP Settings **/
    /** wp-content path */
    define('FS_METHOD', 'ftpext');
    define('FTP_BASE', '/ebs01/www/testdomain4.com/');
    define('FTP_CONTENT_DIR', '/ebs01/www/testdomain4.com/wp-content/');
    define('FTP_PLUGIN_DIR', '/ebs01/www/testdomain4.com/wp-content/plugins/');
    define('FTP_USER', 'testdomain4.com');
    define('FTP_PASS', 'XXXXXXXXXXXX');
    define('FTP_HOST', 'ftp.enterpriseit.us');
    define('FTP_SSL', false);

    When attempting a plugin install I new receive a new error... hooray... right?

    New Error:
    Downloading install package from http://downloads.wordpress.org/plugin/the-welcomizer.1.3.4.9.zip…

    Unpacking the package…

    Could not copy file. /ebs01/www/testdomain4.com/wp-content/upgrade/the-welcomizer.tmp/

    I then did the following in /wp-content:

    sudo mkdir upgrade
    sudo chmod -R 775 upgrade
    sudo chmod g+s upgrade

    When I reran the plugin installer I received the same "Could not copy..." error

    I have not reverted any changes. There are no additional directories or files in plugins or upgrade.

  14. eitsadmin
    Member
    Posted 1 year ago #

    I made the following chages:

    //* FTP Settings **/
    /** wp-content path */
    define('FS_METHOD', 'ftpext');
    define('FTP_BASE', '/');
    define('FTP_CONTENT_DIR', '/wp-content/');
    define('FTP_PLUGIN_DIR', '/wp-content/plugins/');
    define('FTP_USER', 'testdomain4.com');
    define('FTP_PASS', 'XXXXXXXXXXXX');
    define('FTP_HOST', 'ftp.enterpriseit.us');
    define('FTP_SSL', false);

    I still receive the same error however there is now a directory in the upgrade folder. See permissions below:

    /wp-content/plugins/
    nothing new
    /wp-content/upgrade/
    drwxrwsr-x 3 root            testdomain4.com.g .
    drwxrwsr-x 5 testdomain4.com testdomain4.com.g ..
    drwxr-xr-x 3 testdomain4.com testdomain4.com.g the-welcomizer.tmp

    Note that the new directory did not carry forward the write bit from the parent directory. I thought that g+s on the parent directory would cause that to carry forward.

  15. Yeeah, sometimes it does and sometimes it doesn't :/ Flavors of Linux are weird that way. Try making /upgrade/ 777 (and delete all the containing folders inside /upgrade/ )

  16. eitsadmin
    Member
    Posted 1 year ago #

    Linux Learning Note:
    g+s causes files and folders created to carry forward the groupw OWNER not permission
    the permission on creation is affected by the current umask setting. The default is 022 and i have modified this in the /etc/sysconfig/httpd and /etc/init.d/functions to be 002.

    This has made no change in the permissions on directory creation.

  17. eitsadmin
    Member
    Posted 1 year ago #

    I did the following:
    sudo chmod 0777 upgrade/

    This had no effect.
    I have reverted by doing the following:
    sudo chmod 0775 upgrade/

  18. Rewinding....

    You said this earlier:
    drwxrwsr-x 3 apache testdomain3.com.g /wp-content/uploads

    When you set up /wp-content/upgrade, did you do that as apache:testdomain3.com.g too?

  19. eitsadmin
    Member
    Posted 1 year ago #

    at this point we are at testdomain4.com... just fyi.

    the uploads directory is not created by default. It is only created after an image upload is completed. I had not done any image uploads yet as we resolved that problem. As such no uploads dir existed. I have uploaded an image to a post and now it exists with the following permissions:

    drwxrwsr-x 3 testdomain4.com testdomain4.com.g plugins
    drwxrwsr-x 3 testdomain4.com testdomain4.com.g themes
    drwxrwsr-x 3 root            testdomain4.com.g upgrade
    drwxrwsr-x 3 apache          testdomain4.com.g uploads

    upgrade is owned by root as it was manually created.
    uploads is owned by apache as it was created via the image upload process.

    Having the uploads folder has made no change in the plugin install outcome.

  20. Same idea :) 4, 3, whatever

    Change upgrade to apache:testdomain4.com.g if you can, please. While WordPress SHOULD be able to create it, I've had moments where my server barfed on it.

  21. eitsadmin
    Member
    Posted 1 year ago #

    I have added the upgrade and uploads folder creation to my initialization script.

  22. eitsadmin
    Member
    Posted 1 year ago #

    I have done the following:
    sudo chown -R apache ./upgrade/

    The ownership is now:

    drwxrwsr-x 3 testdomain4.com testdomain4.com.g plugins
    drwxrwsr-x 3 testdomain4.com testdomain4.com.g themes
    drwxrwsr-x 3 apache          testdomain4.com.g upgrade
    drwxrwsr-x 3 apache          testdomain4.com.g uploads

    I cleaned out the upgrade folder and rearn plugin install. I have the same problem still.

    I wdid not revert this change as it should be a benign change.

  23. eitsadmin
    Member
    Posted 1 year ago #

    Side Note:

    When i manually add a file or directory under the upgrade folder, using ftp client, it is added with the group write bit set. When i install a plugin, the folder that is created does not have the group write bit set.

  24. Well that makes a bit of sense... When you do it via WordPress it's running as whomever runs PHP. If you check the folders in uploads, I suspect they'd be the same as for upgrade...

    What are the permissions/ownerships for the folders and files in the plugins directory?

    FWIW, here's how the plugin upgrade via WordPres works:
    1) Download the zip file to /wp-content/upgrade
    2) Explode the zip
    3) COPY the unzipped folder to /wp-content/plugins/

    I THINK we're at step 3 now, so I'm leaning to thinking the error is it can't overwrite the files. This MAY be due to the group/owner mismatch.

  25. eitsadmin
    Member
    Posted 1 year ago #

    I disagree in that we are step 3. I think we are at step 2. The directory structure for the plugin exists in the upgrade folder but there are no files at all in any of the subdirs.

  26. A, sorry, you're right. I thought the .tmp folder was ... A folder not a file. Bad read on my end, sorry.

    What version of PHP do you have installed? And is it SuPhp or suhosin?

  27. eitsadmin
    Member
    Posted 1 year ago #

    PHP Version:
    php5 latest from amzn rpm using yum

    I don't even know what SuPHP or suhosin are

Topic Closed

This topic has been closed to new replies.

About this Topic