I have a student who is trying to set up Local. She got permissions set now but when she tries to start a new site, if she sets it to php 7.3.5 she gets a critical error but if she sets it to 7.4.1 her site name turns red with a red exclamation point in a circle next to it. She is unable to get a new site running.
Troubleshooting Questions
Are you able to create a new, plain WordPress site in Local and access it in a Browser? No
Replication
Describe the steps that others can take to replicate this issue. If you have screenshots that can help clarify what is happening, please include them!
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.
Thanks for your response! This is one of our WordPress students (from GeekPack®) so I’m passed along the question. I have gotten some things to try from Flywheel, as well. It looks like her Local is under one user name and the actual sites are being installed to a different directory, so I’m having her look at that, as well. I’ll post as soon as I have an answer from her. If she can get Local to work, she is considering using Flywheel for hosting, so I definitely want to get her setup so she can continue with the course and host with Flywheel. Thanks!
Thanks Sam! So, I thought that the issue might be that it looked like she had the Local app installed on one directory but the Local Sites folder for the sites she was creating was on a different directory.
I thought she might try uninstalling Local and setting it up so that everything was on one directory. Now she can’t get Local to install at all. Someone from Flywheel had suggested this:
When trying to install Local, did you make sure to run it set as Administrator? (Right-click → Run asAdministrator). Local usually asks for this by default however, if it does not have the correct permissions to create a directory,Local` might be running with administrator permissions.
She tried that and still can’t get Local to install. She gets this error.
One other thing, she said it didn’t give her any information when she hovered over or clicked on the red exclamation point when she was able too add a new site.
I gotcha, she literally hasn’t even been able to start a site yet, so she doesn’t have anything to back up. But we do encourage regular backups of anything they are working on, so I’ll be sure she knows.
Hey everyone, sorry for the hassle with this, and thanks for all the debugging info @shanwynn !
In general, when a site in the sites list is red, that means that there was an error during the provisioning step – basically the various server processes couldn’t be compiled or started. I know that’s pretty vague, but there could be lots of reasons for a site to not provision.
Permissions issues are a common source of this problem, and you mention that the student fixed the permissions, but can you elaborate on what exactly was done?
When I look at the Local log (the local-lightning.log within the zip file that was uploaded) I’m seeing a number of lines that relate to issues with provisioning the site. The errors seem to fall into two general categories:
Problem 1. Two Windows user profiles?
It seems like there are two user profiles being used, MegW and willi. From the Log file, it seems like Local is still trying to reference resources between those two profiles. For example, note how this line is trying to copy a file from willi’s folder to MegW’s folder:
You mention that some of the fixes involved consolidating the folders, as well as installing as an administrator. Local probably shouldn’t be installed as and Admin, it just needs to occasionally get admin privileges. I’d start by completely uninstalling Local, both as a regular user, as well as an administrator. For detailed info about the kinds of things to delete, take a look at this help doc:
From there, delete any of the temporary files that Local is using (or even just delete the temp folder) for the user willi. From the above error lines, it looks like that location is at:
C:\\Users\\willi\\AppData\\Local\\Temp
Problem 2. Local can’t reach things on the internet
There are a couple of errors related to Local not being able to reach remote sites like wordpress.org and cdn.localwp.com. The specific error lines look like:
{"thread":"main","class":"WordPressInstaller","message":"Could not fetch latest WordPress version.request to https://api.wordpress.org/core/version-check/1.7/ failed, reason: getaddrinfo ENOTFOUND api.wordpress.org","type":"system","errno":"ENOTFOUND","code":"ENOTFOUND","level":"error","stack":"FetchError: request to https://api.wordpress.org/core/version-check/1.7/ failed, reason: getaddrinfo ENOTFOUND api.wordpress.org\n at ClientRequest.<anonymous> (%%appPath%%\\node_modules\\node-fetch\\lib\\index.js:1461:11)\n at ClientRequest.emit (events.js:315:20)\n at TLSSocket.socketErrorListener (_http_client.js:469:9)\n at TLSSocket.emit (events.js:315:20)\n at emitErrorNT (internal/streams/destroy.js:106:8)\n at emitErrorCloseNT (internal/streams/destroy.js:74:3)\n at processTicksAndRejections (internal/process/task_queues.js:80:21)","timestamp":"2022-06-10T15:11:23.583Z"}
When Local can’t reach the cdn.localwp.com site, it is unable to download additional services like different versions of PHP. That’s likely part of why changing to different versions of PHP was causing issues with provisioning a site.
As for the wordpress.org domain – if Local can’t reach that domain, then it can’t get the files to create a WordPress site.
The reason that I lump these two issues together is that it seems like something is preventing Local from reaching the internet. Common reasons for this are:
Antivirus settings. Are there any security settings in place that are preventing access to certain domains?
Wifi security. Are there any security settings in place on the wifi router, or LAN that the user is connecting to?
VPN. Similar to Wifi issues, is the user using a VPN to connect to the net? Maybe there are some issues with the VPN that are preventing Local from accessing those sites.
I hope that gives you some areas to investigate. As a big test, you might try creating a new Windows user and installing Local from scratch after investigating the various settings. Let us know what you find while investigating those things, along with whatever was done to get things up and running.
Thanks so much for taking a look and providing information on the errors. I told her that having Local on one user directory and her Local sites on another was likely at least part of the problem. She uninstalled and attempted to install on the other user profile and now Local won’t install at all.
Here is a more recent Local-log and the error she is getting.
@ben.turner , thank you so much for your help! The issue has been resolved and she is happily using Local. The only thing she has left to figure out is why she has to turn her anti-virus software every time she uses Local.