WordPress.org

Forums

[resolved] Installation confused about plugin location (18 posts)

  1. martonic
    Member
    Posted 2 years ago #

    Help please - our installation is confused about where to update its plugins.

    We first installed WordPress in a subdirectory and then we moved it to the root by following the instructions here

    http://codex.wordpress.org/Moving_WordPress#Moving_WordPress_Within_Your_Site

    (and we ran the search and replace php script).

    So now, the plugins our installation uses are in the directory

    www/wp-content/plugins

    and those plugins work fine. If we manually upload a plugin to that directory, WordPress detects it, we can activate it, and it works normally.

    However, when it comes time to update, delete, or automatically install a plugin, our installation operates on the old directory:

    www/wp/wp-content/plugins

    I would like to fix this.

    Can anyone tell me where, in the database, is the information that tells WordPress where to operate on the installed plugins? This seems to be different than the information that tells it from where to LOAD the installed plugins. I would call this a BUG - but meanwhile, would like to find a way to correct this problem.

  2. Lindsay T
    Member
    Posted 2 years ago #

    Perhaps check your wp-config.php

    Did you happen to have previously defined your plugins folder?

    http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content_folder

  3. martonic
    Member
    Posted 2 years ago #

    Thank you very much!

  4. martonic
    Member
    Posted 2 years ago #

    Unfortunately, changing wp-config.php did not seem to help.

    For example, wp-config.php has this:

    define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/wp-content' );
    define( 'WP_CONTENT_URL', 'http://sitename.com/wp-content');

    (the text is not "sitename", it is the actually web site name)

    I log into dashboard and it says I need to update two themes (twenty-ten and twenty-eleven).

    If I update them, it changes the content HERE:

    $_SERVER['DOCUMENT_ROOT'] . '/wp/wp-content/themes'

    NOT here:

    $_SERVER['DOCUMENT_ROOT'] . '/wp-content/themes'

    It says both updates are successful BUT as soon as I click "Dashboard", it STILL says that two themes need to be updated.

    WordPress is READING our content from the correct location, but WRITING it to the wrong location!

    Any help will be appreciated enormously!

  5. esmi
    Forum Moderator
    Posted 2 years ago #

    Try commenting out those two lines in wp-config.php

  6. martonic
    Member
    Posted 2 years ago #

    Example 2. I install a plugin and it lands here:

    $_SERVER['DOCUMENT_ROOT'] . '/wp/wp-content/plugins'

    and I go to the plugins page and it is NOT THERE.

    I manually MOVE the new directory into this location:

    $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins'

    and THEN WordPress agrees that we have a new plugin installed.

    Any ideas?

  7. martonic
    Member
    Posted 2 years ago #

    esmi wrote:

    Try commenting out those two lines in wp-config.php

    Thanks esmi but it makes no difference. It worked that way BEFORE I added those lines to wp-config.php, and it still works the same crazy way AFTER I added them in. I then went to the Settings page and clicked 'Submit' (without changing anything) but that made no difference either.

  8. esmi
    Forum Moderator
    Posted 2 years ago #

    When you moved this site, did you carry out a full search & replace of all urls in the database?

  9. martonic
    Member
    Posted 2 years ago #

    I ran the "search and replace php script" but I cannot be 100% sure that it worked correctly. However, the site does run at its new location and WP READS the plugins, themes and so on from the correct location, it just continues to WRITE them (including updates) to the wrong one.

    Hence my original question in the first post above:

    Can anyone tell me where, in the database, is the information that tells WordPress where to operate on the installed plugins? This seems to be different than the information that tells it from where to LOAD the installed plugins. I would call this a BUG - but meanwhile, would like to find a way to correct this problem.

  10. esmi
    Forum Moderator
    Posted 2 years ago #

    I'd suggest looking in the wp_options table. As far as I can recall, the data should not be serialized.

  11. martonic
    Member
    Posted 2 years ago #

    Thanks.

    I only found one entry with the string '/wp/' in the option_value field.

    The option_name is "recently_edited" and the length of each sub-string (a total of five "s:xxx" values) is embedded in the data (error-prone for manual editing).

    It does not seem like the "recently_edited" row should be causing these problems. But then again, I don't understand why "recently_edited" would be considered an "option" in the first place. I surely don't know what effect this entry is supposed to have on the site behavior.

  12. esmi
    Forum Moderator
    Posted 2 years ago #

    That's nothing to do with your plugins folder. Can you go through exactly what steps you used to move this site?

  13. martonic
    Member
    Posted 2 years ago #

    1) Administration > Settings > General panel.

    2) Changed WordPress Address and Site Address from http://wp/sitename.com to http://sitename.com.

    3) Clicked "Save Changes".

    4) Copied wp-admin, wp-content, wp-includes directories from public-html/wp to public-html.

    5) Copied .htaccess, index.php, xmlrpc.php, and all of the wp-*.php files from public-html/wp to public-html.

    6) Edited index.php (in the root directory). Changed "require('./wp/wp-blog-header.php');" to "require('./wp-blog-header.php');".

    7) Ran the "Search and Replace for WordPress Databases Script" from here:

    http://interconnectit.com/products/search-and-replace-for-wordpress-databases/

    Changed all matching references from "sitename/wp/" to "sitename/".

    8) Opened the admin site which was a bit tricky. I don't recall how I finally got into the site at this point.

    9) Administration > Settings > Permalinks

    10) Clicked "Save Changes". The contents of sitename/.htaccess did not need to be changed; it already matched what was shown. It has the permalink code and nothing else.

    I think that's it.

  14. esmi
    Forum Moderator
    Posted 2 years ago #

    So you didn't follow the instructions in this Codex section?

  15. martonic
    Member
    Posted 2 years ago #

    That is exactly what I followed, or tried to follow, as well as I could understand it.

    Can you point to something I did wrong?

  16. esmi
    Forum Moderator
    Posted 2 years ago #

    4) Copied wp-admin, wp-content, wp-includes directories from public-html/wp to public-html.

    Why did you copy and not move?

  17. martonic
    Member
    Posted 2 years ago #

    The necessity was to have the files available in a new location. I kept the old ones "just in case". As it turns out, IIRC the first time I could not get into the admin site at sitename/admin, I had to use sitename/wp/admin - so if I had deleted ("moved") those files, I would have been SOL. However, the existence of files that are not referenced should mean nothing. WP had been told to look for them in a new location. Why should it matter if they are also present in an old location, or a dozen other locations that WP has been told NOT to use? It should not matter at all. If you are saying that was a mistake, and it led to the current behavior, for which there is still no explanation in sight, I would like to see some justification for that opinion. I still don't see why WP should be attempting to update files in a location that is not referenced either in the database, or in any of the configuration files - or how it can know where the files are for the purpose of READING them, but not for the purpose of WRITING them. That makes no sense - so it must be incorrect, and a reference to that directory must still exist somewhere in the working image. However, the mere EXISTENCE of an old directory should have no effect whatsoever. If this is wrong, please explain how it can be wrong. Thanks for your help!

  18. martonic
    Member
    Posted 2 years ago #

    SOLVED

    There is NOTHING in the WordPress database nor configuration that tells WP where to install/update themes or plugins!

    It is entirely controlled by the default access for the FTP ACCOUNT that is used for this purpose.

    I simply needed to update the FTP credentials so that an account would be used that defaults to the correct location (now the root).

Topic Closed

This topic has been closed to new replies.

About this Topic