WP CLI errors, "Failed loading ... opcache.so" "xdebug.so" and "Warning: PHP Startup: Unable to load dynamic library ... imagick.so" code unsigned

I’m having trouble replicating, but I also noticed some odd things when taking a close look at my own .zshrc as well as @jb510’s .zshrc.

Something about this that feels like a $PATH issue, possibly relating to child-shells.

I’d be curious to know what your $PATH looks like. I used this to change the colons to new lines, which I think makes it easier to read. The top lines have a higher precedent than the lower lines:

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

For me, I would have thought that Local’s config would put the Local site items as a higher precedent than anything else, but in actuality, there are a few items that are “put ahead” of those folders:

I think that the reason that there are repeated items in my PATH is due to the Local shell script using exec $SHELL (ie, creating a subshell) as opposed to just sourceing the file.

@jb510 can you try sourceing the “open shell script” instead of running it as a sub-shell? Specifically do:

  1. In Local, click “Open Site Shell”. This will create the shell script.
  2. Edit the file that was run using “open site shell”
  3. Comment out the last line that says exec $SHELL
  4. Save the file
  5. In a non-Local shell, (ie, a new one) try running that script and see how that affects the $PATH

Here’s a screenshot to help visualize:

It’s important to note that when you click the “Open Site Shell” button within Local, the shell script is regenerated, so any edits you make to that script will be wiped out if you try to open the shell from Local.

The reason to try these things is to see if the act of creating a subshell (and therefore, reloading all of the zsh config) is causing issues with how things are being loaded.