Error codes using WP CLI

Bug Summary

When I run any wp cli command, I get two errors. I am using PHP 8.3.0 on an Apple M1 Pro.

  • Failed loading /Users/djave_co/Library/Application Support/Local/lightning-services/php-8.3.0+1/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20230831/opcache.so: dlopen(/Users/djave_co/Library/Application Support/Local/lightning-services/php-8.3.0+1/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20230831/opcache.so, 0x0009): symbol not found in flat namespace ‘_pcre2_code_free_8’
  • Warning: Module “imagick” is already loaded in Unknown on line 0

Steps to reproduce

  1. Open the site shell.
  2. Run wp db check

The biggest issue is that we populate sites using wordpress commands, so running commands like:

wp post delete --force $(wp post list --post_type='attachment' --format=ids)

Will count every word as output.

Warning: Failed deleting post Warning:.
Warning: Failed deleting post Module.
Warning: Failed deleting post "imagick".
Warning: Failed deleting post is.
Warning: Failed deleting post already.
Warning: Failed deleting post loaded.
Warning: Failed deleting post in.
Warning: Failed deleting post Unknown.
Warning: Failed deleting post on.
Warning: Failed deleting post line.
Warning: Failed deleting post 0.

Environment Info

Describe your environment.

  • What Operating System are you using? Mac OSC, M1 Pro chip
    local-lightning.log (26.5 KB)

  • What versions of site software (Nginx, Apache, PHP, MySQL) is used? PHP 8.3.0, MySQL 8.0.16

  • What version of Local is installed? Version 9.0.3+6684


WP-CLI: WP-CLI 2.9.0
Composer: 2.6.2 2023-09-03
PHP: 8.3.0
MySQL: mysql Ver 8.0.16 for macos10.14 on x86_64 (MySQL Community Server - GPL)

Supporting info

Please provide your Local Log. See this Community Forum post for instructions on how to do so:

Hi @djave!

For clarity did this work previously or was this your first time attempting it? I just want to rule a change after a certain update.

Does this same behavior happen for a new, blank site in Local or are these specific sites you’re working on after importing?

Hi @Nick-B - yes that’s right, it happens on a totally fresh WP install.

I downloaded the latest local for Apple silicon. If I change PHP versions I get different errors, some missing opcache or other libraries.

Previous versions of local used to let you use the wp cli with no errors. I hope that clarifies!

I noticed that you mentioned MacOS 10.14. Is this your OS version?

Hi Nick, ah that is a good point. No I am using OSX Version 13.5.

That output is from the top of the terminal window when you open site shell in local.

This turned out not to be a localwp issue.

I had installed Laravel Herd a while back, and as a result that installs its own version of PHP and libraries (imagick etc). The way Herd works is it appends lines to your .zshrc that add its own version of PHP to $PATH (I think). I uninstalled herd, and deleted the lines from .zshrc and now Local runs its own versions of everything.

I should delete this issue as it isn’t a local bug, but incase it helps others after me I’ll leave it here. Thanks for the support @Nick-B

1 Like

Hi @djave - No worries here! Thank you for coming back and sharing the details for others to find. I’ve changed your post topic from a Bug to a Support category :slight_smile:

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.