# Wrong PHP version in site shell

**URL:** <https://community.localwp.com/t/wrong-php-version-in-site-shell/24835>\
**Category:** Support\
**Tags:** site-shell, php\
**Created:** [March 15, 2021, 9:39am UTC](https://community.localwp.com/t/wrong-php-version-in-site-shell/24835 "2021-03-15T09:39:27Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![afragen](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/afragen/32/31_2.png) [@afragen](https://community.localwp.com/u/afragen)\
**Post date:** [March 16, 2021, 2:40pm UTC](https://community.localwp.com/t/wrong-php-version-in-site-shell/24835/8 "2021-03-16T14:40:12Z")

</div>

You must have something in you .zshrc file or .bashrc that causes those paths to reload in the beginning of the PATH with each session.

You might need to load them to the end of the PATH not he beginning.

Something similar to this might also work,

> **[WP CLI errors, "Failed loading ... opcache.so" "xdebug.so" and "Warning: PHP...](https://community.localwp.com/t/wp-cli-errors-failed-loading-opcache-so-xdebug-so-and-warning-php-startup-unable-to-load-dynamic-library-imagick-so-code-unsigned/22719/33)**
>
> @ipstenu I found that if I did the following \[stuff deleted\] I think what may be safer would be to add /opt/homebrew/bin /opt/homebrew/sbin to /etc/paths NB: The above seems to work without issues.

---

_[View the full topic](https://community.localwp.com/t/wrong-php-version-in-site-shell/24835)._
