PHP CLI in terminal don't changing to right version

I have 2 version of PHP (7.1 and 8.0.3) on XAMP, and Apache works good, but on terminal I cant work correctly, eg  with composer


1 comment
Comment actions Permalink

PHP interpreters in PhpStorm only affect PhpStorm itself, they don't modify the system environment.
If you want to change the PHP version in the terminal, you should change your environment accordingly. The way you can do that depend on the OS you use and on the method you installed PHP with.

If it's Windows (at least it looks like it), you need to add the directory where the XAMPP's php.exe is located to the $PATH variable, and make sure no other $PATH entry overrides it.

1

Please sign in to leave a comment.