macOS Ventura WP-CLI fatal error TypeError: implode()

Bug Summary

I can’t run WP-CLI in the site shell. I get Fatal error: Uncaught TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/DocParser.php:75.

Steps to reproduce

  • Install Local on macOS Ventura on an M1 machine.
  • Create a WordPress site.
  • Open the site shell.
  • Try to run WP-CLI: wp --version.
  • Get the fatal error.

Environment Info

Describe your environment.

  • What Operating System are you using? macOS Ventura
  • What versions of site software (Nginx, Apache, PHP, MySQL) is used? nginx, PHP 8.1.9, MySQL 8.0.16, WP 6.3, localhost routing mode.
  • What version of Local is installed? 7.1.2+6410

Supporting info

Please provide your Local Log. See this Community Forum post for instructions on how to do so:
local-lightning.log (60.7 KB)

Include any screenshots or video recordings of the issue to help others reproduce.

❯ wp --version
Failed loading /Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-8.1.9+8/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20210902/opcache.so:  dlopen(/Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-8.1.9+8/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20210902/opcache.so, 0x0009): tried: '/Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-8.1.9+8/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20210902/opcache.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-8.1.9+8/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20210902/opcache.so' (no such file), '/Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-8.1.9+8/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20210902/opcache.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
Failed loading /Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-8.1.9+8/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20210902/xdebug.so:  dlopen(/Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-8.1.9+8/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20210902/xdebug.so, 0x0009): tried: '/Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-8.1.9+8/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20210902/xdebug.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-8.1.9+8/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20210902/xdebug.so' (no such file), '/Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-8.1.9+8/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20210902/xdebug.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

Fatal error: Uncaught TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/DocParser.php:75
Stack trace:
#0 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/DocParser.php(75): implode(Array, '\n')
#1 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CompositeCommand.php(32): WP_CLI\DocParser->get_longdesc()
#2 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(113): WP_CLI\Dispatcher\CompositeCommand->__construct(Object(WP_CLI\Dispatcher\RootCommand), 'cache', Object(WP_CLI\DocParser))
#3 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(45): WP_CLI\Dispatcher\CommandFactory::create_composite_command(Object(WP_CLI\Dispatcher\RootCommand), 'cache', 'Cache_Command')
#4 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php(513): WP_CLI\Dispatcher\CommandFactory::create('cache', 'Cache_Command', Object(WP_CLI\Dispatcher\RootCommand))
#5 phar:///usr/local/bin/wp/vendor/wp-cli/cache-command/cache-command.php(12): WP_CLI::add_command('cache', 'Cache_Command')
#6 phar:///usr/local/bin/wp/vendor/composer/autoload_real.php(66): require('phar:///usr/loc...')
#7 phar:///usr/local/bin/wp/vendor/composer/autoload_real.php(56): composerRequire6501cc48682cc22d1e9df4be5afc251e('8a0ad02df6a5087...', 'phar:///usr/loc...')
#8 phar:///usr/local/bin/wp/vendor/autoload.php(7): ComposerAutoloaderInit6501cc48682cc22d1e9df4be5afc251e::getLoader()
#9 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/AutoloaderStep.php(46): require('phar:///usr/loc...')
#10 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(74): WP_CLI\Bootstrap\AutoloaderStep->process(Object(WP_CLI\Bootstrap\BootstrapState))
#11 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(23): WP_CLI\bootstrap()
#12 phar:///usr/local/bin/wp/php/boot-phar.php(11): include('phar:///usr/loc...')
#13 /usr/local/bin/wp(4): include('phar:///usr/loc...')
#14 {main}
  thrown in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/DocParser.php on line 75

Hi @andfinally

Is this a site you just imported into Local from elsewhere or one you were working on previously?

Hi @Nick-B, it’s one I created from scratch. Your question made me wonder if it could be something in a plugin or theme, so I’ve just tried it on a plain Wordpress site with no installed plugins or themes, and no other customisations, and I’m getting the same result.

What version of WP-CLI displays from the Site Shell?

This is what I get on clicking β€œOpen site shell”. Looking more carefully at the output, it looks like the SSH session isn’t starting. I’m still in my host session, in the site’s directory.

Last login: Wed Aug 16 21:57:00 on ttys000
/Users/administrator/Library/Application\ Support/Local/ssh-entry/TnqkNkB1r.sh
❯ /Users/administrator/Library/Application\ Support/Local/ssh-entry/TnqkNkB1r.sh
-n -e 
Setting Local environment variables...
----
WP-CLI:   WP-CLI 2.7.1
Composer: 2.1.5 2021-07-23
PHP:      8.1.9
MySQL:    mysql  Ver 8.0.16 for macos10.14 on x86_64 (MySQL Community Server - GPL)
----
Launching shell: /bin/zsh ...
 ~/Local Sites/wordpress/app/public ξ‚°       

You might try updating WP-CLI.

wp cli update

Might help, might not.

Thanks Andy, didn’t help, unfortunately – I get the same Failed loading /Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-8.1.9+8/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20210902/opcache.so:... output.

When I click on β€œOpen site shell”, I’d expect my terminal to open an SSH session to the WordPress container. But that doesn’t seem to be happening.

Hi @andfinally - I know you’re on an M1 machine, but are you using the Apple Silicon build of Local or the Intel build?

Second, if you’re on the Apple Silicon build, do you have Rosetta 2 installed on your machine? On my personal machine (technically M2), with the Apple Silicon build and Rosetta 2 installed, I’m not able to replicate the error. wp --version executes successfully.

This part of your error message makes me think wires are crossed somewhere:
(mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

Hi @austinwendt, I installed the Silicone build to make sure, and I do have Rosetta 2 – unfortunately I’m still getting the same result. It’s like the SSH session doesn’t start, so when I do wp --version, I’m calling it on the host machine, inside the site folder, where I guess WP-CLI isn’t available. Should clicking β€œOpen site shell” get me straight into an SSH session inside the container, or am I supposed to call ssh in Terminal to start it?

I’ve tried troubleshooting this some more, and I haven’t been able to reproduce… can you try to recreate this screenshot with any of your sites so that I can see what you’re seeing? This is on my M2, Silicon build of Local with Rosetta installed.

You’re correct, opening the site shell and running this command is calling the command on your machine from within the app/public directory of the site, and WP-CLI should be accessible here.

When you say β€œSSH session inside the container”, can you explain more what you mean? Local doesn’t use any containerizing solution, so just want to make sure we’re talking about the same thing.

Thanks for giving it a go @austinwendt, I’ve tried switching to site domains router mode and also to iTerm2, and tried to reproduce your setup, but I still get the same result. I’ve included two terminals in this screenshot – the top one shows what I get immediately after clicking β€œOpen site shell”, the bottom one shows the error on calling wp --version. Very puzzling!

Apologies, I forgot Local doesn’t run in a container – am I right in thinking it’s a VirtualBox VM? I have VirtualBox 6.1 installed, not sure if that might be conflicting with the Local version somehow. I should’ve said β€œSSH session inside the VM” or β€œinside the WordPress web server”.

Hey @andfinally, I’ve tried reproducing a bit and not getting the same behavior.

Local’s Site Shell is a regular shell with some additions to the PATH and other environment variables so that everything is wired up correctly.

I wonder if there may be an issue with the PATH and how ZSH is configured?

As a troubleshooting step, can we get a closer look at your $PATH as well as get a better idea of how you have zsh configured? For example, from the terminal prompt, it looks like it’s styled by Oh-my-zsh.

For the PATH part, I usually run this command in the terminal:

echo $PATH | tr ':' '\n'

For the zsh config, I’d be most interested in any config that configures wpcli. Also, if you have your config files in a dot-files repo, that would be great to get a better idea of what’s going on. For example, while I don’t have your same prompt style, here’s my ZSH config on Github: .zshrc

Thanks @ben.turner, I really appreciate the thought you guys are putting into this! Path is below, and .zshrc attached. (I had to delete a few sensitive aliases and functions, but I’m pretty confident they have no impact.) There is no mention of WP-CLI and I don’t have installed on my host machine. I have it inside some Docker containers, but it isn’t exposed to the outside.

❯ echo $PATH | tr ':' '\n'
/Users/administrator/.nvm/versions/node/v16.18.0/bin
/Users/administrator/.rvm/gems/ruby-2.4.1/bin
/Users/administrator/.rvm/gems/ruby-2.4.1@global/bin
/Users/administrator/.rvm/rubies/ruby-2.4.1/bin
/Users/administrator/Library/pnpm
/usr/local/opt/openssl@1.1/bin
/Users/administrator/.pyenv/shims
/usr/local/opt/openjdk@11/bin
/usr/local/opt/inetutils/libexec/gnubin
/Users/administrator/.composer/vendor/bin
/usr/local/sbin
/usr/local/mysql/bin
/usr/local/bin
/Users/administrator/bin
/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Library/Apple/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
/Users/administrator/shell-scripts
/Users/administrator/.rvm/bin

zshrc.txt.zip (4.2 KB)

Nice! Thanks for providing that info!

That path looks normal, and it appears that this is withough clicking through Local’s β€œOpen site shell”

That’s fine, but you’ll notice additional paths if you go through Local.

After looking at your PATH output and the previous screenshots, I noticed something that I missed when I was initially trying to replicate. It looks like on my machine, I get a odd, though less β€œnoisy,” output when I use PHP 8.2.8.

I see from your PATH and the zshrc file that you have some logic in there for running PHP/Composer – do you do Laravel/vanilla PHP work?

I wonder if the reason for our different experiences boils down to a PHP configuration issue – ie, maybe you have a PHP config setting that is more strict and bombs out on deprecation notices, while my system is using the Local default config and just does the PHP thing of happily going along even though something is deprecated :joy:

To get a better idea of the environment of the Local site shell, can you:

  1. Open a new Local site shell, but clicking β€œOpen site shell”
  2. Provide the output of the PATH variable
  3. Let us know which php/composer binary the shell is using
  4. Get an idea of what PHP config is used. The awk statement below looks gnarly, but basically just outputs the first part of the php --info section that includes β€œConfiguration File”
echo $PATH | tr ':' '\n'
which php
which composer

php --info | awk 'BEGIN{ RS = "" ; FS = "\n" }$0 ~ /Configuration File/{print $0}'

Here’s my output with the above commands for my 8.2.8 site:

I’d be curious if:
a. you have a different β€œConfiguration file” than me
b. you have any β€œAdditional .ini files parsed”

Lastly, for reference, here’s the β€œError Reporting” settings for the PHP config for the Local site I’m using for QA:

awk 'BEGIN{ RS = "" ; FS = "\n" }$0 ~ /Error Handling/{print "\n" $0 "\n"}' /Users/ben.turner/Library/Application\ Support/Local/run/EwESiiV6Z/conf/php/php.ini            

; Error Handling
error_reporting = E_ALL & ~E_DEPRECATED
error_log = "/Users/ben.turner/Local Sites/cli-implode/logs/php/error.log"
log_errors = On
display_errors = On
display_startup_errors = On
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
html_errors = On

Can you take a look at things and let us know the output of those things?

Cheers for the careful look @ben.turner, I’m learning some useful stuff! Here’s the path from β€œOpen site shell”

❯ echo $PATH | tr ':' '\n'
/Users/administrator/Library/pnpm
/usr/local/opt/openssl@1.1/bin
/Users/administrator/.pyenv/shims
/usr/local/opt/openjdk@11/bin
/usr/local/opt/inetutils/libexec/gnubin
/Users/administrator/.composer/vendor/bin
/usr/local/sbin
/usr/local/mysql/bin
/usr/local/bin
/Users/administrator/bin
/Applications/Local.app/Contents/Resources/extraResources/bin/composer/posix
/Applications/Local.app/Contents/Resources/extraResources/bin/wp-cli/posix
/Users/administrator/Library/Application Support/Local/lightning-services/php-8.2.8+1/bin/darwin-arm64/bin
/Applications/Local.app/Contents/Resources/extraResources/lightning-services/mysql-8.0.16+6/bin/darwin/bin
/Users/administrator/.rvm/gems/ruby-2.4.1/bin
/Users/administrator/.rvm/gems/ruby-2.4.1@global/bin
/Users/administrator/.rvm/rubies/ruby-2.4.1/bin
/Users/administrator/Library/pnpm
/usr/local/opt/openssl@1.1/bin
/Users/administrator/.pyenv/shims
/usr/local/opt/openjdk@11/bin
/usr/local/opt/inetutils/libexec/gnubin
/Users/administrator/.composer/vendor/bin
/usr/local/sbin
/usr/local/mysql/bin
/usr/local/bin
/Users/administrator/bin
/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Library/Apple/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
/Users/administrator/shell-scripts
/Users/administrator/.rvm/bin
/Users/administrator/shell-scripts

Composer and PHP locations:

❯ which php
/usr/local/bin/php
❯ which composer
/usr/local/bin/composer

PHP info output:

❯ php --info | awk 'BEGIN{ RS = "" ; FS = "\n" }$0 ~ /Configuration File/{print $0}'
Failed loading /Users/administrator/Library/Application Support/Local/lightning-services/php-8.2.8+1/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20220829/opcache.so:  dlopen(/Users/administrator/Library/Application Support/Local/lightning-services/php-8.2.8+1/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20220829/opcache.so, 0x0009): tried: '/usr/local/Cellar/openssl@1.1/1.1.1j/lib/opcache.so' (no such file), '/opcache.so' (no such file), '/Users/administrator/Library/Application Support/Local/lightning-services/php-8.2.8+1/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20220829/opcache.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/administrator/Library/Application Support/Local/lightning-services/php-8.2.8+1/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20220829/opcache.so' (no such file), '/Users/administrator/Library/Application Support/Local/lightning-services/php-8.2.8+1/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20220829/opcache.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
Failed loading /Users/administrator/Library/Application Support/Local/lightning-services/php-8.2.8+1/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so:  dlopen(/Users/administrator/Library/Application Support/Local/lightning-services/php-8.2.8+1/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so, 0x0009): tried: '/usr/local/Cellar/openssl@1.1/1.1.1j/lib/xdebug.so' (no such file), '/xdebug.so' (no such file), '/Users/administrator/Library/Application Support/Local/lightning-services/php-8.2.8+1/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/administrator/Library/Application Support/Local/lightning-services/php-8.2.8+1/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so' (no such file), '/Users/administrator/Library/Application Support/Local/lightning-services/php-8.2.8+1/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
System => Darwin bras-base-marvpq1603w-grc-01-142-122-13-2.dsl.bell.ca 22.5.0 Darwin Kernel Version 22.5.0: Mon Apr 24 20:52:24 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T6000 x86_64
Build Date => Aug 16 2023 21:18:20
Build System => Darwin Ventura 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar 6 21:00:17 PST 2023; root:xnu-8796.101.5~3/RELEASE_X86_64 x86_64
Configure Command =>  './configure'  '--prefix=/usr/local/Cellar/php/8.2.9' '--localstatedir=/usr/local/var' '--sysconfdir=/usr/local/etc/php/8.2' '--with-config-file-path=/usr/local/etc/php/8.2' '--with-config-file-scan-dir=/usr/local/etc/php/8.2/conf.d' '--with-pear=/usr/local/Cellar/php/8.2.9/share/php/pear' '--enable-bcmath' '--enable-calendar' '--enable-dba' '--enable-exif' '--enable-ftp' '--enable-fpm' '--enable-gd' '--enable-intl' '--enable-mbregex' '--enable-mbstring' '--enable-mysqlnd' '--enable-pcntl' '--enable-phpdbg' '--enable-phpdbg-readline' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--with-apxs2=/usr/local/opt/httpd/bin/apxs' '--with-bz2=/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr' '--with-curl' '--with-external-gd' '--with-external-pcre' '--with-ffi' '--with-fpm-user=_www' '--with-fpm-group=_www' '--with-gettext=/usr/local/opt/gettext' '--with-gmp=/usr/local/opt/gmp' '--with-iconv=/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr' '--with-kerberos' '--with-layout=GNU' '--with-ldap=/usr/local/opt/openldap' '--with-libxml' '--with-libedit' '--with-mhash=/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr' '--with-mysql-sock=/tmp/mysql.sock' '--with-mysqli=mysqlnd' '--with-ndbm=/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr' '--with-openssl' '--with-password-argon2=/usr/local/opt/argon2' '--with-pdo-dblib=/usr/local/opt/freetds' '--with-pdo-mysql=mysqlnd' '--with-pdo-odbc=unixODBC,/usr/local/opt/unixodbc' '--with-pdo-pgsql=/usr/local/opt/libpq' '--with-pdo-sqlite' '--with-pgsql=/usr/local/opt/libpq' '--with-pic' '--with-pspell=/usr/local/opt/aspell' '--with-sodium' '--with-sqlite3' '--with-tidy=/usr/local/opt/tidy-html5' '--with-unixODBC' '--with-xsl' '--with-zip' '--with-zlib' '--enable-dtrace' '--with-ldap-sasl' '--with-os-sdkpath=/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk' 'PKG_CONFIG_PATH=/usr/local/opt/apr/lib/pkgconfig:/usr/local/opt/openssl@3/lib/pkgconfig:/usr/local/opt/apr-util/lib/pkgconfig:/usr/local/opt/argon2/lib/pkgconfig:/usr/local/opt/brotli/lib/pkgconfig:/usr/local/opt/libidn2/lib/pkgconfig:/usr/local/opt/libnghttp2/lib/pkgconfig:/usr/local/opt/libssh2/lib/pkgconfig:/usr/local/opt/openldap/lib/pkgconfig:/usr/local/opt/rtmpdump/lib/pkgconfig:/usr/local/opt/lz4/lib/pkgconfig:/usr/local/opt/xz/lib/pkgconfig:/usr/local/opt/zstd/lib/pkgconfig:/usr/local/opt/curl/lib/pkgconfig:/usr/local/opt/unixodbc/lib/pkgconfig:/usr/local/opt/libpng/lib/pkgconfig:/usr/local/opt/freetype/lib/pkgconfig:/usr/local/opt/fontconfig/lib/pkgconfig:/usr/local/opt/jpeg-turbo/lib/pkgconfig:/usr/local/opt/highway/lib/pkgconfig:/usr/local/opt/imath/lib/pkgconfig:/usr/local/opt/libtiff/lib/pkgconfig:/usr/local/opt/little-cms2/lib/pkgconfig:/usr/local/opt/openexr/lib/pkgconfig:/usr/local/opt/webp/lib/pkgconfig:/usr/local/opt/jpeg-xl/lib/pkgconfig:/usr/local/opt/libvmaf/lib/pkgconfig:/usr/local/opt/aom/lib/pkgconfig:/usr/local/opt/libavif/lib/pkgconfig:/usr/local/opt/gd/lib/pkgconfig:/usr/local/opt/gmp/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/krb5/lib/pkgconfig:/usr/local/opt/libpq/lib/pkgconfig:/usr/local/opt/libsodium/lib/pkgconfig:/usr/local/opt/libzip/lib/pkgconfig:/usr/local/opt/oniguruma/lib/pkgconfig:/usr/local/opt/pcre2/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig:/usr/local/opt/sqlite/lib/pkgconfig:/usr/local/opt/tidy-html5/lib/pkgconfig' 'PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/13' 'KERBEROS_CFLAGS= ' 'SASL_CFLAGS=-I/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sasl' 'SASL_LIBS=-lsasl2'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/etc/php/8.2
Loaded Configuration File => /Users/administrator/Library/Application Support/Local/run/TnqkNkB1r/conf/php/php.ini
Scan this dir for additional .ini files => /usr/local/etc/php/8.2/conf.d
Additional .ini files parsed => /usr/local/etc/php/8.2/conf.d/ext-opcache.ini

I see there seems to be some issue with opcache.

Output of the additional ini file:

❯ cat /usr/local/etc/php/8.2/conf.d/ext-opcache.ini
───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       β”‚ File: /usr/local/etc/php/8.2/conf.d/ext-opcache.ini
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   β”‚ [opcache]
   2   β”‚ zend_extension=/usr/local/opt/php/lib/php/20220829/opcache.so
───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Error reporting settings:

; Error Handling
error_reporting = E_ALL & ~E_DEPRECATED
error_log = "/Users/administrator/Local Sites/wordpress/logs/php/error.log"
log_errors = On
display_errors = On
display_startup_errors = On
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
html_errors = On

Sorry to barge in like that into an unrelated thread, but out of curiosity: is there finally a LocalWP Apple Silicon Build that would even work without Rosetta because it uses ARM-native lighning-services mysql, NGiNX and Mailhog?

The latest I could find is 7.1.2+6410, and it still opens the only intel-compiled processes to be found on my Mac, making me somewhat sceptical as to if there ever will be a truly ARM-native LocalWP.

I think it’s all about the lightning-services.

Hey @andfinally – Thanks for your patience with this!

It definitely looks like the system version of PHP is taking precedence over Local’s version of PHP:

Note that because the /usr/local/bin is β€œhigher” than the folder’s that Local adds, when your shell looks for the php binary, it stops when it finds the system one.

This is usually due to the shell config re-adding items to the PATH.

I’m going to do some tinkering to see if there is a better way to guard against this kind of problem, but as a work-around, I wonder if you were to update your ZSH config. Looking at the output from the PATH command, you might try moving these lines from a .zshrc file to a .zprofile file:

/Users/administrator/Library/pnpm
/usr/local/opt/openssl@1.1/bin
/Users/administrator/.pyenv/shims
/usr/local/opt/openjdk@11/bin
/usr/local/opt/inetutils/libexec/gnubin
/Users/administrator/.composer/vendor/bin
/usr/local/sbin
/usr/local/mysql/bin
/usr/local/bin
/Users/administrator/bin

Judging from the output, I’m guessing that .rvm config would also be in the .zprofile file?

After you do this, you’d need to log back out and back in again. The reason for moving to .zprofile is that the items in that file are sourced just once when you log in. The items in the .zshrc file are sourced every time a shell is spawned, which is why you see the above lines repeated after Local’s lines.

I realize this is annoying and consider this more of a workaround, but I am curious if that fixes things so that you don’t get that output in your shell.

No β€œonly Apple Silicon” build yet – as you and @afragen say, the Nginx, Mailhog, and Mysql lightning services need to be compiled.

Most of our recent effort has been improving our CI/CD processes for PHP so that it doesn’t take a year to come around and compile new patch versions of PHP. I don’t have an ETA for when we’ll get to those other services.

@philby – it’s probably a good idea to create a Feature requests to get those other Lightning Services worked on so we can communicate and prioritize the work!

2 Likes

@philby Hey Phil - no worries, thanks for hopping in.

Not yet, there isn’t an Apple Silicon build of Local that doesn’t require Rosetta 2. Like @afragen mentioned, it is about the lightning services (PHP, mySQL, nginx, Apache, etc). The app itself + PHP are compiled for Apple Silicon, and that is where 90%+ of the performance improvements came from. Beyond the app + PHP, we saw diminishing returns as we looked into the other services.

That’s not to say it won’t happen, or that it isn’t still on the radar. It is something we plan to do! We’ve been heads down in PHP land and pipeline automation to make that smooth going forward - and frankly, so we have time to do other things like this rather than get pulled into PHP updates several times a year :slight_smile:

Edit: Ben must have been typing at the same time, ha! I think we have an existing feature request, but yes, we’re on it and I appreciate the bump.

3 Likes