PHP versions conflicts

Hi, I have setup a site in Local and the PHP version i set to version 8.1.23. However if I run php --version in Terminal console I get 8.0.28. I have also tested this when opening site shell from Local. This does not make sense to me and it is causing me some trouble. How can I remedy this? :slight_smile:
I am on a Mac OS 14.0

Hi @vayu - can you share screenshots of what you’re seeing? I agree, that would be odd if this is happening in Local’s site shell.

Can you try switching your PHP version inside Local, say to PHP 8.0, and then switching back to PHP 8.1 - does that resolve the issue?

Hi, thanks for asking :slight_smile: Now that you ask, I do notice an error in the terminal, and it is something to do with php 8.1.23. I don’t really understand the error.

Failed loading /Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/opcache.so: dlopen(/Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/opcache.so, 0x0009): tried: ‘/Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/opcache.so’ (mach-o file, but is an incompatible architecture (have ‘x86_64’, need ‘arm64’)), ‘/System/Volumes/Preboot/Cryptexes/OS/Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/opcache.so’ (no such file), ‘/Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/opcache.so’ (mach-o file, but is an incompatible architecture (have ‘x86_64’, need ‘arm64’))
Failed loading /Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/xdebug.so: dlopen(/Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/xdebug.so, 0x0009): tried: ‘/Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/xdebug.so’ (mach-o file, but is an incompatible architecture (have ‘x86_64’, need ‘arm64’)), ‘/System/Volumes/Preboot/Cryptexes/OS/Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/xdebug.so’ (no such file), ‘/Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/xdebug.so’ (mach-o file, but is an incompatible architecture (have ‘x86_64’, need ‘arm64’))

Warning: PHP Startup: Unable to load dynamic library ‘/Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/imagick.so’ (tried: /Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/imagick.so (dlopen(/Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/imagick.so, 0x0009): tried: ‘/Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/imagick.so’ (mach-o file, but is an incompatible architecture (have ‘x86_64’, need ‘arm64’)), ‘/System/Volumes/Preboot/Cryptexes/OS/Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/imagick.so’ (no such file), ‘/Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/imagick.so’ (mach-o file, but is an incompatible architecture (have ‘x86_64’, need ‘arm64’))), /opt/homebrew/Cellar/php@8.0/8.0.28/lib/php/20200930//Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/imagick.so.so (dlopen(/opt/homebrew/Cellar/php@8.0/8.0.28/lib/php/20200930//Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/imagick.so.so, 0x0009): tried: ‘/opt/homebrew/Cellar/php@8.0/8.0.28/lib/php/20200930//Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/imagick.so.so’ (no such file), ‘/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/php@8.0/8.0.28/lib/php/20200930//Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/imagick.so.so’ (no such file), ‘/opt/homebrew/Cellar/php@8.0/8.0.28/lib/php/20200930//Users/-/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/lib/php/extensions/no-debug-non-zts-20210902/imagick.so.so’ (no such file))) in Unknown on line 0


The error messages are super helpful, thank you! I assume you’re on an Apple Silicon (M1, M2, or M3) Mac? Are you using the Intel or Apple Silicon build of Local?

The error implies it is trying to access the ARM64 version and only getting the Intel version - if you download the ARM64 version from localwp.com/releases, I assume the error will resolve!