If I try and run a wp cli command from a Local instance I get the following error
Failed loading /Users/coreyhorob/Library/Application Support/Local/lightning-services/php-8.0.30+0/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20200930/opcache.so: dlopen(/Users/coreyhorob/Library/Application Support/Local/lightning-services/php-8.0.30+0/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20200930/opcache.so, 0x0009): symbol not found in flat namespace ‘__zend_get_parameters_array_ex’
Failed loading /Users/coreyhorob/Library/Application Support/Local/lightning-services/php-8.0.30+0/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20200930/xdebug.so: dlopen(/Users/coreyhorob/Library/Application Support/Local/lightning-services/php-8.0.30+0/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20200930/xdebug.so, 0x0009): symbol not found in flat namespace ‘__zend_get_parameters_array_ex’
Error: /opt/homebrew/Cellar/wp-cli/2.10.0/bin/wp is not writable by current user.
What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc
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.
Thanks for the report, @coreyallen. I can’t reproduce this on macOS so far (I tried Intel and Apple Silicon).
From the /opt/homebrew/Cellar/wp-cli/2.10.0/bin/wp path, it looks like the command is being invoked using a wp installed globally via homebrew.
If you’re not already, opening a shell via Local’s “open site shell” should set paths in a way that overrides your global wp to use the version that ships with Local (which should ensure PHP extensions are loaded correctly).
If that doesn’t help, you could try temporarily uninstalling your global wp (brew uninstall wp-cli) and opening the site shell again, which should ensure Local’s wp is used.
Thanks for replying @nickc . So I uninstalled wp-cli, opened shell via local and now when I try and run a wp command I get zsh: command not found: wp. Strange thing is the shel message does say has wp-cli Zight 2024-03-27 at 3.58.15 PM
when I try and run a wp command I get zsh: command not found: wp.
Did you try restarting Local and your terminal application after removing the global version of WP-CLI?
If that doesn’t work, you could try opening Local’s site shell and typing echo $PATH. You should see the string, “/Applications/Local.app/Contents/Resources/extraResources/bin/composer/posix” somewhere in the path, which Local needs to find wp when it’s not installed globally.
If you don’t see that string, it’s possible that a custom zsh config or something else on your system is modifying the PATH in an unexpected way.
Agreed, it looks like something’s overriding Local’s additions to your PATH.
I’d start by checking your zsh config (normally at ~/.zshrc).
As a workaround you could edit your config to add Local’s path to wp (/Applications/Local.app/Contents/Resources/extraResources/bin/composer/posix), but it would be better to remove anything overriding the PATH if possible.
Really appreciate your patience with this @nickc
so I added it to my .zshrc file Zight 2024-03-28 at 10.58.2... rebooted my machine, but when I do echo $PATH from local terminal again that new line isn’t in there
But I would instead recommend commenting out all lines in your .zshrc file by prefixing them with # (or temporarily renaming the file so it’s no longer read by zsh), then closing and opening your terminal. If wp in a Local site shell then works, you know the issue is something in that file, and could comment out individual lines until you find the one.