I am running a Mac, and unfortunately have the different versions of PHP running in the CLI and on Apache. I have searched and can find instances of this question before but have not been able find a reason this occurs or how to resolve the issue.
When I run phpinfo(); and load it in the browser I get the following:
Loaded config file: /etc/php.ini
Server Path: /usr/bin:/bin:/usr/sbin:/sbin
But when I run php -v & php --ini in the command line, I get the following:
Loaded config file: /usr/local/lib/php.ini
When I run 'whereis php' it shows /usr/bin/php and when I run 'which php' I get /usr/local/bin/php.
Can anyone explain why this has happened? And does anyone know how this can be resolved? I would like to, if possible, resolve the underlying issue rather than find a workaround. I'd also like to uninstall the version of PHP that is not being used.