• Resolved normando1

    (@normando1)


    I’ve never tried building a localhost WordPress site before. I thought it would be a good way to redesign my current site without getting involved with my hosting company, however, I’ve run into the same problems over and over again that I’ve not been able to even get started. I successfully installed and am running XAMPP 8.2.4-0 on my Mac using OS 13.3.1 (a). I installed WordPress 6.2.2.

    I originally set up the new site using Elementor, or started to. After studying a number of tutorials, as well as having plugin installation issues, I began to think it wasn’t really going to fit my needs so I deleted everything including WordPress and started over. I opened a 2nd WordPress folder (after deleting the first one) from the original downloaded .zip file (was that a mistake?). I copied the files to a new site folder in htdocs in XAMPP. I set up a new database file and logged into the site at localhost/(mysite)/wp-admin/.

    Everything looked fine until I tried to delete “Hello Dolly” just for the heck of it. I got a request for FTP credentials (something I haven’t been able to find good description of or solution to, other than–) something I’d run into before and inserted the “define(‘FS_METHOD’,’direct’);” code into the wp-config.php file to get around it.

    Now when I try to install Visual Composer, or Jetpack, for instance, I get the dreaded “Installation failed: Could not create directory. /Applications/XAMPP/xamppfiles/htdocs/(mysite)/wp-content/upgrade”

    Besides this (or maybe connected to it) the Site Health status is showing me “Background updates are not working as expected” with a long list of .php files in wp-includes, and others.

    Is this something that can be fixed? Should I start all over again with a new WordPress installation? I worked with WordPress many, many years ago, but that was directly on a hosted server, not local. I never had these kinds of problems before.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Your file system, from the docroot on down, should be owned by the same ID under which PHP is running.

    I know we could dig into XAMPP, but if you’re just looking for an “it just works” experience, I strongly recommend installing the free WP system from https://localwp.com.

    Moderator bcworkz

    (@bcworkz)

    Like Steve said, your issues are due to file ownership. There are a few possible solutions if you want to stay with XAMPP. One, like he said, is to chown everything in htdocs to be the PHP user. They are currently probably owned by your user since XAMPP is probably running under your user’s authority. The PHP user is defined in Apache configuration. It’s often www-data by default. You could change this to be your user instead (assuming you currently own the file system). Restart Apache if you change anything in its configuration.

    Another solution is expand all file permissions to allow write/delete for groups as well as owner (775/664). This would normally greatly reduce security, but if you and www-data are the sole users of localhost it’s of little consequence.

    Finally, you could enable the FTP server in XAMPP and provide the related credentials to WP when prompted.

    Thread Starter normando1

    (@normando1)

    Thanks for getting to me Steven and bcworkz. I’m still trying to solve this problem. After searching the internet up and down, at least I know I’m not the only one to run into this. Although, none of the “solutions” I’ve tried to implement have done any good. (I hope it’s alright to reply to both of you at one time.)

    Steven: I might have to try Flywheel’s Local app. and if I can’t get this straightened out I”ll have to. I’m a little wary of it, particularly when it comes to migrating the re-designed site over to GoDaddy (no comments, please). AS to your statement about the whole file system owned by the same user as the PHP is running, I don’t know who else that could be but me. Since I’m setting this up on my localhost I should be able to get through with my Mac admin and password. When I put that into the request panel I get: “Failed to connect to FTP Server localhost:21”. I get the same thing when I put in my WordPress username and password for the site, so I don’t really think I’m progressing.

    bcworkz: As I said above there should be no other user than me, and I’ve tried various usernames and passwords with no effect. I looked through the Apache Web Server Configure file and found nothing about PHP User. There are instructions out there for using the Terminal to do things like change permissions. I’m not that experienced with using Terminal, but I have used it when instructed to. As far as enabling the ProFTPD server, I haven’t seen any instructions for that and providing (mystery) credentials is sort of what this problem is all about. Most of the instructions I find are about “check with your hosting service” to get them, but since this is n/a on localhost, I’m still at a loss.

    I’ll continue to try some of the solutions out there including:
    “…Then add these to wp-config.php:
    /** Add here/
    define(‘FS_METHOD’,’direct’);
    define(“FTP_HOST”, “localhost”);
    define(“FTP_USER”, “my_wordpress_user”);
    define(“FTP_PASS”, “password”);
    /* To here*/”
    which seemed logical but did nothing but give me a blank screen when I logged in again.

    I’ve already tried the “define( ‘FS_METHOD’, ‘direct’ );” workaround but that got me “unable to create directory” along with the stunning question, “Is its parent directory writable by the server?” (And if not, why not, I want to ask as well.)

    Anyway, Thanks for your help, guys.

    Thread Starter normando1

    (@normando1)

    I CAN’T BELIEVE IT! This solved the problem. I’ve already opened two new plugins with no problems. I’m leaving the url here for anyone else who has the same issue. Soooooo simple!
    “The correct way to fix this issue…” https://silvawebdesigns.com/how-to-fix-unable-to-connect-to-the-filesystem-please-confirm-your-credentials-in-wordpress/

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

The topic ‘Installation failed: Could not create directory. . . .wp-content/upgrade’ is closed to new replies.