M1 Mac loading X86 libraries - local lightning (opcache, xdebug, imagick)

Thanks for sharing your shell output, @sebastian.

Just to make sure I downloaded the latest version for apple silicon. (Maybe I downloaded the wrong version at some point?)

Downloading the Intel version of Local, running it on an Apple Silicon Mac, then later installing the Apple Silicon version could explain the messages you have about x86_64 versions of PHP extensions such as opcache.so and xdebug.so. Those versions would have been installed by the original Intel version of Local and could still be on your system.

To fix it you can try these steps:

  1. Confirm the current version of Local you have installed is the Apple Silicon build. To be sure, open a terminal and run this:

    file /Applications/Local.app/Contents/MacOS/Local
    

    You should see a line ending in ‘arm64’:

    /Applications/Local.app/Contents/MacOS/Local: Mach-O 64-bit executable arm64
    

    If you see x86_64 instead of arm64, download and install the latest Apple Silicon version from Releases - Local before you continue.

  2. Stop your sites and close Local if it’s running.

  3. In the Finder, choose Go → Go to Folder.

  4. Enter ~/Library/Application Support/Local/lightning-services/ and press enter.

  5. In the Finder window that opens, delete all folders with a php- prefix, as well as the mailpit-1.12.1+0 folder (you might have the old Intel binary for that too):

  6. Launch Local. It will see that PHP and mailpit are missing, and copy the Apple Silicon versions of PHP 8.1.23 (and Mailpit) to the lightning-services folder you were just looking at.

  7. Click one of your sites.

    • If it was using PHP 8.1.23, toggle it to another version to download that version, then back to PHP 8.1.23. You should be able to start the site as normal and open the site shell without seeing warnings.
    • If it was using another version of PHP, there should be a banner at the top of the window saying “Missing PHP 8.2”. When you start this site, Local will download the Apple Silicon PHP version to replace the old version you had with Intel libraries.
    • You can optionally toggle an existing site between different PHP versions to force Local to download the Apple Silicon binaries and libraries for other PHP versions.

This process replaces the Intel versions of PHP and libraries like imagick.so you may have installed accidentally by downloading the Intel version (or that could have come from a full disk restore from a previous Intel Mac, for example) with the Apple Silicon versions, and should remove the errors you saw.

1 Like