• I’m trying to update to WordPress 4.5.1 from 4.4.2 but the update fails because WordPress is unable to locate the root directory. I’m running the WordPress installation on a standard Ubuntu 14.04 setup.

    My first guess was that this is a file/folder permission related error, but that doesn’t make sense since all plugins have been updated frequently without any problems for months.

    Echoing ABSPATH gives me /var/www/html/

    Help is appreciated…

Viewing 3 replies - 1 through 3 (of 3 total)
  • It could still be a file/folder permissions error – I’ve definitely seen some installs where the core directory permissions are configured differently than the wp-content folder, where all of the plugins, themes and uploaded media live.

    It sounds like the path to your document root may well be /var/www/html/ – that’s a very common path for a webroot, especially on an Ubuntu box. Have you tried updating the permissions on that directory and trying again? If you attempt this, you should probably keep track of the permission of the files and directories in the root directory, as well as the wp-content directory, so you can reset them to their original settings if needed.

    For the sake of fun, here’s a heapin’ helpin’ of file permissions info, straight from the official wordpress site: https://codex.www.ads-software.com/Changing_File_Permissions — giving this a read may be worth while if permissions are indeed your problem. Plus it will tell you what your permissions should be, and why.

    In case the above doesn’t work out – would you mind sharing whether you’re controlling permissions via Terminal, FTP Client or cPanel?

    Thread Starter virtous

    (@virtous)

    Hey thanks for your reply. I still haven’t managed to solve this issue despite reading through the article you linked.

    I’m controlling permissions via terminal. If I knew which files/folders are handled during WordPress core upgrades I could see if those files/folders have the correct permissions set. Do you by any chance know which files/folders are relevant?

    Thanks

    Thread Starter virtous

    (@virtous)

    I finally managed to fix this by temporarily changing the owner of all files within /var/www/html.

    I normally set the FTP user as the owner and www-data as the owning group.

    1) Change file owner
    sudo chown www-data: -R /var/www/html

    2) Update wordpress

    3) Change back ownership
    sudo chown myftpaccount: -R /var/www/html

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WordPress core update, can't locate root directory’ is closed to new replies.