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.