Php issue site name in red

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:

{"thread":"main","class":"WordPressInstaller","stack":"Error: EBUSY: resource busy or locked, rename 'C:\\Users\\willi\\AppData\\Local\\Temp\\IUBsNs4PCupgrade.php.tmp' -> 'C:\\Users\\MegW\\LocalSites\\sheltertas2022\\app\\public\\wp-admin\\includes\\upgrade.php'","level":"error","message":"Error installing WordPress","timestamp":"2022-06-10T04:57:36.281Z"}
{"thread":"main","reason":{"errno":-4082,"code":"EBUSY","syscall":"rename","path":"C:\\Users\\willi\\AppData\\Local\\Temp\\IUBsNs4PCupgrade.php.tmp","dest":"C:\\Users\\MegW\\LocalSites\\sheltertas2022\\app\\public\\wp-admin\\includes\\upgrade.php"},"p":{},"eventId":"c1f2df0b9a404915971fbef80c03920c","level":"warn","message":"Unhandled Rejection.","timestamp":"2022-06-10T04:59:11.210Z"}

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","reason":{"errno":-3008,"code":"ENOTFOUND","syscall":"getaddrinfo","hostname":"cdn.localwp.com"},"p":{},"eventId":"08bfc752602c422f91d90fcba3184374","level":"warn","message":"Unhandled Rejection.","timestamp":"2022-06-10T13:51:19.483Z"}

and

{"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.