Came across the problem that when I wanted to require a new module using composer (through the console), the module wouldn't install because composer wanted a higher PHP version to do it (the CLI Version is the one used by the console).
Luckily, there is a way to switch PHP versions in the console (if your hoster has installed it)
alias php='/opt/php82/bin/php' echo "alias php='/opt/php82/bin/php'" >> ~/.bash_profile export PATH=/opt/php82/bin:$PATH echo "export PATH=/opt/php82/bin:\$PATH" >> ~/.bash_profile
the above example is for PHP 8.2 and it's typically how hosters would install it, but there might be variations.
- Log in to post comments
Comments