Manually add PHP 7.4 to lighting-services

Issue Summary

My corp network is blocked downloadable PHP version call. So I can’t get the correct PHP version to test the site. At the moment it is only using default PHP 7.3.

  • Is there a manual way to install additional version of PHP? I have tried to drop the folder with PHP 7.4 into this lighting-services folder but it is not working. macOS popup with code-signing warning.

  • What are the external URLs that Local calls that would make this to work? I need the list so I can make whitelist request to our IT team.

Troubleshooting Questions

  • Does this happen for all sites in Local, or just one in particular?

This is happening for any sites.

  • Are you able to create a new, plain WordPress site in Local and access it in a Browser?

I can create with PHP 7.3 but not with PHP 7.4 (drop-in)


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!

Try to work-around but not working

  • On personal machine go to ~/Library/Application Support/Local/lightning-services
  • Move php-7.4.1+16 to work machine ~/Library/Application Support/Local/lightning-services
  • Start a new site with select PHP 7.4.1 version
  • macOS will popup with “…was blocked from use because it is not from an identified developer”
  • Click Allow anyway but there is nothing happening

System Details

  • Which version of Local is being used?
    Tried 5.10.5, 6.1.1

  • What Operating System (OS) and OS version is being used?

    • macOS BigSur
  • Attach the Local Log. See this Community Forum post for instructions on how to do so:

    {"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%userDataPath%%/lightning-services/php-7.4.1+16/lib/main.js","timestamp":"2021-08-18T15:16:54.730Z"}
    {"thread":"main","class":"AddonLoaderService","level":"info","message":"Successfully Loaded Add-on: %%userDataPath%%/lightning-services/php-7.4.1+16/lib/main.js","timestamp":"2021-08-18T15:16:54.760Z"}
    {"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%resourcesPath%%/lightning-services/mailhog-1.0.0+3/lib/main.js","timestamp":"2021-08-18T15:16:54.761Z"}
    {"thread":"main","class":"AddonLoaderService","level":"info","message":"Successfully Loaded Add-on: %%resourcesPath%%/lightning-services/mailhog-1.0.0+3/lib/main.js","timestamp":"2021-08-18T15:16:54.763Z"}
    {"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%resourcesPath%%/lightning-services/mariadb-10.4.10+4/lib/main.js","timestamp":"2021-08-18T15:16:54.764Z"}
    {"thread":"main","class":"AddonLoaderService","level":"info","message":"Successfully Loaded Add-on: %%resourcesPath%%/lightning-services/mariadb-10.4.10+4/lib/main.js","timestamp":"2021-08-18T15:16:54.791Z"}
    {"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%resourcesPath%%/lightning-services/mysql-8.0.16+6/lib/main.js","timestamp":"2021-08-18T15:16:54.792Z"}
    {"thread":"main","class":"AddonLoaderService","level":"info","message":"Successfully Loaded Add-on: %%resourcesPath%%/lightning-services/mysql-8.0.16+6/lib/main.js","timestamp":"2021-08-18T15:16:54.815Z"}
    {"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%resourcesPath%%/lightning-services/nginx-1.16.0+5/lib/main.js","timestamp":"2021-08-18T15:16:54.816Z"}
    {"thread":"main","class":"AddonLoaderService","level":"info","message":"Successfully Loaded Add-on: %%resourcesPath%%/lightning-services/nginx-1.16.0+5/lib/main.js","timestamp":"2021-08-18T15:16:54.838Z"}
    {"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%resourcesPath%%/lightning-services/php-7.3.5+11/lib/main.js","timestamp":"2021-08-18T15:16:54.839Z"}
    {"thread":"main","class":"AddonLoaderService","level":"info","message":"Successfully Loaded Add-on: %%resourcesPath%%/lightning-services/php-7.3.5+11/lib/main.js","timestamp":"2021-08-18T15:16:54.860Z"}
    {"thread":"main","reason":{"code":"SELF_SIGNED_CERT_IN_CHAIN"},"p":{},"level":"warn","message":"Unhandled Rejection.","timestamp":"2021-08-18T15:16:56.282Z"}
    {"thread":"main","class":"ConfigTemplatesService","message":"Compiling service configs...","level":"info","timestamp":"2021-08-18T15:18:21.475Z"}
    {"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2021-08-18T15:18:22.882076Z 0 [System] [MY-010116] [Server] %%resourcesPath%%/lightning-services/mysql-8.0.16+6/bin/darwin/bin/mysqld (mysqld 8.0.16) starting as process 70249","timestamp":"2021-08-18T15:18:23.566Z"}
    {"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2021-08-18T15:18:22.886872Z 0 [Warning] [MY-013243] [Server] --character-set-server: The character set UTF8MB3 is deprecated and will be removed in a future release. Please consider using UTF8MB4 instead.","timestamp":"2021-08-18T15:18:23.566Z"}
    {"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2021-08-18T15:18:22.887678Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for %%site.runData%%/mysql/data/ is case insensitive","timestamp":"2021-08-18T15:18:23.567Z"}
    {"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2021-08-18T15:18:23.181929Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.","timestamp":"2021-08-18T15:18:23.567Z"}
    {"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2021-08-18T15:18:23.199800Z 0 [System] [MY-010931] [Server] %%resourcesPath%%/lightning-services/mysql-8.0.16+6/bin/darwin/bin/mysqld: ready for connections. Version: '8.0.16'  socket: '%%site.runData%%/mysql/mysqld.sock'  port: 10008  MySQL Community Server - GPL.","timestamp":"2021-08-18T15:18:23.567Z"}

Aren’t IT departments a pleasure to deal with when all you want to do is just Do The Work :tm: :smiley:

It’s been a while since I’ve broken Local as deeply as when i was trying to manually install a lightning service:

From my testing, I don’t think there’s a way to manually install these services – you’ll keep running into permissions issues related to how Mac requires signatures on all the various supporting libraries and tools.

Basically there are two parts to a lightning service, the Typescript files that Local uses to use the service and the actual binary that “does stuff.”

You might be able to get the IT department to whitelist this pattern:*

Which should allow you to download any php service. For reference, here are the two things that Local would download when getting the php-7.4.1+17 lightning service:

Hey, Ben. Thank you for answering the question and also doing the tests. Just wish we have some control on getting these services.

IT do whitelist most of packages from npm/composers/brew so I thought maybe there is a way to work around for local.

Yeah, I believe the best bet is to whitelist the domain. I also can’t do auth with to install the add-ons. But I guess, add-ons can install manually.

Thanks again, Ben.

@ben.turner Just want to report back that I finally got IT approved to whitelist so the issue with PHP is resolved. But I do have a question related to this is when I try to install add-on, I got Error Popup saying self-signed certificate in chain. IT ask if the app have the ability to trust a Certificate Authority. Please see the screenshot attached.

Do you know how?

1 Like

Ahh yeah, that error makes sense. The general idea is that Local is trying to download additional things over HTTPS (from your screenshot, I think an add-on), but because there is a self-signed certificate in the keychain (ie, from the IT department) Local can’t create a secure connection.

Local doesn’t have that ability at this time. I would think that if a certificate was trusted by the system, Local would use it. If you open the Keychain and inspect the self-signed certificate from IT what’s the setting?

If you change it to a value like “Always Trust” and re-try installing the add-on, does that help? The screen should look something like this:

Image 2021-08-19 at 10.46.25 AM

Thanks for the your answer, Ben. The issue is they have over 160+ certs on the machine and I am not sure which one Local is using… I will go back to IT and check with them.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.