Unable to create new site, PHP version never loads

What issue or error are you experiencing?

I can’t create a new site. If I try to create one using the preferred server settings, I get this error: Uh-oh! Unable to provision site.
Error: Error: ENOENT: no such file or directory, scandir ‘/Users/laurayeffeth/Library/Application Support/Local/lightning-services/php-8.3.0+1/bin’
at Object.readdirSync (node:fs:1527:3)
at t.readdirSync (node:electron/js2c/node_init:2:11289)
at LightningServicesService.getPlatformFromService (/Applications/Local.app/Contents/Resources/app.asar/main/sites/LightningServicesService.js:1:4348)
at LightningServicesService.getRegisteredServices (/Applications/Local.app/Contents/Resources/app.asar/main/sites/LightningServicesService.js:1:4114)
at LightningServicesService. (/Applications/Local.app/Contents/Resources/app.asar/main/sites/LightningServicesService.js:1:4931)
at Generator.next ()
at o (/Applications/Local.app/Contents/Resources/app.asar/main/sites/LightningServicesService.js:1:849)

If I try to set custom server settings, PHP version never loads for me to select.
On all my existing sites, PHP version never loads – these sites run just fine though.


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

I have created new sites since buying this computer. I tried reinstalling local and rebooting my computer. I checked and Rosetta 2 is already installed.

System Details

  • Local Version:
    Version 9.0.5+6706
  • Operating System (OS) and OS version:
    Apple M2 Max, 14.6.1 (23G93)

Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)

I tried to download my logs and nothing happens. The download does not initiate.

Security Reminder
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.

Hi @laurayeffeth

Could you share a full copy of your Local Log here? There are some different ways to access and share Local Logs. For us to be able to troubleshoot thoroughly, please click the Download Local Logs button from the Support tab in Local. This will generate a zip archive that contains the Local log along with some other diagnostic information to help quickly zero in on any issues that Local is encountering.

The download button isn’t working. It just doesn’t create the file. Is there another way to get the log?

local-lightning.log.zip (8.7 KB)
Downloaded the log manually.

Since this is a new machine I’m assuming it has plenty of disk space?

Are you running other developer applications simultaneously as well? Apps like MAMP, XAMPP, or Docker for example.

When you reinstalled Local did you first delete Local’s configuration folder by navigating to “~/Library/Application Support” and deleting the “Local” folder? If not you could export and save your sites, and then try another full refresh.

Yes, there is plenty of disk space.

I am not running any other developer apps.

I did not do that so I did that now. I attempted to then import one of my sites and that worked. However the second import failed (and all future attempts):

Since I had backed up all the sites, I tried re-installing a second time, deleting the local folder and starting anew. Then I tried just adding a new blank site and it just got stuck on “Adding”. I stopped that and downloaded the logs (which I can do now) and I noticed that there are still logs from 2023. Is there anything else I am supposed to delete for a completely fresh install?

Log zip attached.
local-logs.zip (1.1 MB)

I have an update. I tried reinstalling and testing a few more times with different scenarios. I can add/import a site as long as it has the preferred server settings (nginx and php 8.1.29 already installed). I thought it was just PHP that was the problem, so I tried adding a site with the installed PHP version, but with Apache but that failed. Then I installed a site with the preferred settings, cloned it and changed the clone web server to apache. That worked. Then I tried to change the php version and that failed. Is there a way to download the PHP versions separately from adding a site? I could try that.

Screenshot 2024-09-11 at 11.12.12

When I get this error and delete the problem site, the original working site, now shows the PHP version as just loading (as was happening on all sites before re-installing). The site still loads.

I hope this additional information helps to troubleshoot.

I was just about to ask if you had tried using NGINX and if that yielded any different results.

It also seems like some type of port conflict is happening. Have you tried changing your Router Mode by going to Preferences >Advanced>Router Mode?

Lastly, do you have any antivirus, security, or firewall applications that could be blocking Local? It looks like from the log it might be having trouble connecting.

I don’t have any antivirus, security or firewall applications. I just tried reinstalling again and setting to router mode (though I really want to be able to use site domains). It added a blank site with preferred settings ok. Switched to Apache ok. Hung up again on switching PHP versions.

I notice that when it is working on setting up the site I can no longer access the internet. That doesn’t seem right, is it?

Now it has gotten past the last part and says it is downloading PHP 7.4.30 (2 of 2) but it shows 0/35 MB) and seems to be stuck there. This also happened once before. I’m not sure how long to wait but it doesn’t seem to be moving.

I just went to re-download the logs and when I went back there was the alert:

Missing PHP 7.4. Don’t worry. We’ll reinstall it next time you start your site.

That seemed like a good sign. The site was already started though. I tried switching to PHP 8.2 instead and the same thing show: downloading 8.2 (4 of 4) 0/61MB. So always 0 MB and the at the last part (even though it just started).

Just waiting now to see if this just doesn’t display the status properly but is actually doing something in the background.

Here are the latest logs, in case that’s helpful.
local-logs1.zip (1.1 MB)

For what it is worth, I also restarted my computer and router. I’m open to any suggestions of things to try and I’m at a loss. I can’t really do much work without local working.

Is there anything unique about your network connection? Are you using a VPN, office/work network, broadband or hotspot?

You definitely shouldn’t lose access to the internet just because you’re starting a site so it seems like some other type of filtering or throttling is happening. Either with the network itself or some other hidden security.

Nothing that I am aware of. My VPN is not active.
I haven’t made any changes whatsoever to my set up to cause a new issue. This was all working for several months after buying the new mac. I can’t think of anything that could have changed.

One error stands out to me:

{"class":"LightningServicesService","code":"ENOENT","errno":-2,"level":"error","message":"ENOENT: no such file or directory, scandir '%%userDataPath%%/lightning-services/php-8.3.0+1/bin'","path":"%%userDataPath%%/lightning-services/php-8.3.0+1/bin","stack":"Error: ENOENT: no such file or directory, scandir '%%userDataPath%%/lightning-services/php-8.3.0+1/bin'\n    at Object.readdirSync (node:fs:1527:3)\n    at t.readdirSync (node:electron/js2c/node_init:2:11289)\n    at LightningServicesService.getPlatformFromService (%%appPath%%/main/sites/LightningServicesService.js:1:4348)\n    at LightningServicesService.getRegisteredServices (%%appPath%%/main/sites/LightningServicesService.js:1:4114)\n    at LightningServicesService.<anonymous> (%%appPath%%/main/sites/LightningServicesService.js:1:4931)\n    at Generator.next (<anonymous>)\n    at o (%%appPath%%/main/sites/LightningServicesService.js:1:849)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","syscall":"scandir","thread":"main","timestamp":"2024-09-11T06:22:42.326Z"}

It almost seems like the 8.3.0+1 Lightning Service is corrupt.

Can you try deleting that version and re-downloading it? We don’t have a good way to do this through the GUI, but the steps are:

  1. Quit Local
  2. Open Local’s user config folder at ~/Library/Application Support/Local/lightning-services
  3. Delete the problem PHP version, for you, that would be php-8.3.0+1
  4. Restart Local and start a site that uses PHP 8.3

Give that a try and let us know how it goes. If you still have issues, can you also provide an updated version of the Local Log?

Those are all just my attempts to load sites using a php version other than 8.1.29 that comes downloaded with the installation. All of those attempts failed. There are no sites running any other version and any attempt to import or add a new blank site with any other version fail. I even tried loading the PHP folders from my old installation with other versions, but that didn’t work either.

After the issue started, I deleted the local folder and so all my sites. I can’t import them back unless I use 8.1.29 regardless of what they were using before.

I gave it another shot and got this error:

Screenshot 2024-09-12 at 11.25.25

Here is the latest log afterwards:
local-logs3.zip (1.1 MB)