• wperic

    (@wperic)


    I’m trying to replace the twenty twenty-one theme ver 1.6 with the 2.5 version on my localhost installation, “wordpress-experiments.”


    I downloaded and unzipped the 2.5 version, then removed the old twenty twenty-one files from the themes directory and pasted in the new files.


    When I restarted the installation, it still showed the 1.6 version. When I tried to delete that version from the themes page, I got this error message:
    “To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.”


    It took me to a page that had a username (eric) and a password preloaded and asked for a hostname. I tried ‘localhost’ and ‘localhost/wordpress-experiments’ In both cases I get this error message:
    “Error: Could not connect to the server. Please verify the settings are correct.”


    So what does FTP have to do with adding or deleting files on my own computer?


    And, how can I manage to get the twenty twenty-one theme updated? (Right now neither the 1.6 nor the 2.5 versions are working.)

Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator threadi

    (@threadi)

    The request for FTP access data occurs if the authorizations for accessing files and directories are not correct. In this case, WordPress tries to recommend FTP as an alternative method. To solve this, you would need to check the directory and file permissions. See also: https://developer.ww.wp.xz.cn/advanced-administration/server/file-permissions/

    And you don’t actually have to update manually, you can simply click on Update in the backend. However, this only works reliably if the directory and file permissions are correct.

    Thread Starter wperic

    (@wperic)

    The nice thing about doing stuff on localhost: I just deleted the whole installation and starting over, with a brand new mariadb wordpress database. I suspect that somehow the order in which I tried to do the update scrambled the wordpress database.

    I think the appropriate steps, e.g. for updating twentytwentyone from 1.6 to 2.5, would be like this:

    0. Close the (localhost) site first?
    1. Delete/remove the existing twentytwentyone directory from the themes directory.
    2. Unzip the downloaded file. This gives, e.g., a directory called twentytwentyone2.5 holding a twentytwentyone directory.
    3. Open that 2.5 directory and move the twentytwentyone directory to the installation’s theme directory.
    4. Reopen the wordpress site. The updated theme should now be available.

    I don’t remember for sure, but I may have gotten in trouble by pasting the new twentytwentyone directory into the themes directory before deleting the old one?

    The remaining question is whether this procedure will wipe out one’s settings, or are those in the database? I.e., does one need a child theme to preserve the settings or just to preserve any changes one makes to the theme’s actual programs?

    And is that answer different for block themes than for the traditional themes?

    Moderator threadi

    (@threadi)

    No, a manual update as you describe did not remove any settings. They are retained, at least as long as they are in the database and not in the theme directory. You shouldn’t change anything in the theme directory anyway unless you are using a child theme.

    But you have carried out a manual update after all. This is not a recommended way. The normal procedure for updates would be to use the update function in the backend. Nobody has to handle ZIP files like you did. This applies to both classic and FSE themes as well as any plugins.

    Thread Starter wperic

    (@wperic)

    But the “normal procedure” and “the update function in the backend” are not available for localhost installation, as far as I know. I did mention that I was talking about a localhost installation. Maybe that’s not the right word. I mean an installation on my laptop at home, which does not have direct access to such updates. I’m quite familiar with using the theme update procedure on live sites on a webhost.

    Moderator threadi

    (@threadi)

    No, the automatic route also works locally without any problems. I use this every day in my local development systems where I develop plugins. Whether it works depends heavily on the permissions I mentioned above. In addition, the local system must of course have access to the Internet, which is ultimately a setting in your network. WordPress doesn’t block anything here.

    Thread Starter wperic

    (@wperic)

    That’s interesting. I’ve been doing WP and Linux for a long time, and I don’t remember ever sensing that I could go out to the internet from my WP on localhost and download files for my WP.

    When I click “add theme” in my localhost installation, I get this error message, “An unexpected error occurred. Something may be wrong with ww.wp.xz.cn or this server’s configuration. If you continue to have problems, please try the support forums.”

    How would I set up my localhost to use the internet to download themes (and WP updates) and still be secure? All my file permissions are 777 (I know, that’s dangerous) and are owned by me. The article on permissions you mentioned above seems focused on WP on an internet hosting service. I don’t want my trial WP installations on my laptop to be internet accessible. So what am I missing here?

    Thanks.

    Moderator threadi

    (@threadi)

    This message again has nothing to do with the permissions of the directories (even if these could also be problematic). It refers to the fact that WordPress cannot access ww.wp.xz.cn from your local system to retrieve information about themes. As mentioned above, this may be a problem with your network. In the simplest case, it is a firewall that is preventing the connection. But it could also be a missing DNS configuration or something similar. It all depends on your network.

    Thread Starter wperic

    (@wperic)

    “Working with an offline WordPress site on your local hard disk, or localhost, is a great way to build your page without sending it live yet. However, there’s no WordPress one-click update option available offline. That’s why you need to update WordPress files and database manually.” (https://ginangiela.com/how-to-update-wordpress-manually-on-localhost/)

    Near as I can tell from searching, the only way around this is to create a live webserver on my laptop that exposes my experimental site to the world. Is there some middle ground I’m not seeing? Does something like XAMPP do that?

    Moderator threadi

    (@threadi)

    To be honest, the article there is not very helpful. Of course, you can also run WordPress locally without any restrictions. There are many ways to do this.

    Some use localwp: https://localwp.com

    XAMPP also works, of course. There are also instructions on how to set it up here: https://developer.ww.wp.xz.cn/advanced-administration/debug/test-driving/#installing-wordpress-on-your-windows-desktop – for Mac computers there is MAMP, for Linux LAMP (or simply use the services provided there).

    The Windows subsystem WSL is very popular for this purpose. This is also used by many in the community for the further development of WordPress Core. Here is an article on this: https://make.ww.wp.xz.cn/core/2019/08/05/wordpress-local-environment/ – there are also many instructions online on how to set up WSL for your Linux.

    The use of Docker is just as widespread. Here is an image for it including instructions: https://hub.docker.com/_/wordpress

    However, I usually use VirtualBox with a Linux system in it. On my laptop, however, I usually prefer to start Docker, as it is available more quickly.

    With neither of these options is the local website published on the internet. That’s not the point of a local environment. XAMPP, for example, technically prohibits this (even if many people get around it and do it anyway).

    So if you want to continue developing locally, take a look at these options. If you have further questions, see if you can find someone in your region to talk to. Meetups are a great way to do this, as are WordCamps.

    Thread Starter wperic

    (@wperic)

    I appreciate you sticking with me on this, Threadi. I think I understand now.

    Lots of my apps can go online to update–Thunderbird, Firefox, Gimp, even Fedora, which I just updated to 42. Likewise, you’re saying, WordPress should be able to go online to update.

    I do have LAMP installed (that is, Apache, MariaDB and PHP on Linux).

    What I don’t know is, how do I configure my WordPress installation to be able to go online and update like these other apps do? Frankly, I don’t know how to even word this query on a search engine. When I try, “How to configure wordpress on my computer to find updates online,” all the results seem to speak to updating WP on some hosted sited and most assume I want to know how to use automatic updating on such a site.

    So where would I find how to configure my WP installation on my computer so WP can go out and find updates the way other apps on the computer seem to do automatically?

    (PS–the last NE Ohio WordPress Meetup activity was August of 2023.)

    Moderator threadi

    (@threadi)

    WordPress does not need to be configured for this, but your system and your network do. You are obviously using a LAMP stack with Fedora. I would therefore recommend that you contact a Fedora community with your request where they can tell you what needs to be configured on their system.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘can’t replace theme with updated theme on localhost installation’ is closed to new replies.