How to use php7.2 in terminal?

Started by jimmyb, March 29, 2018, 12:27:16 AM

Previous topic - Next topic

jimmyb

I am using the php selector I am able to use php 7.2 by adding it to the .htaccess files and it works but how do I switch in the command line / terminal ?

locvfx

Using an alias to change the PHP version, you can read more details here :
https://help.dreamhost.com/hc/en-us/articles/214202148-How-do-I-change-the-PHP-version-my-shell-uses-

Just make sure your path to php is correct

thefantas

/opt/alt/php72/usr/bin/php-cgi -q -c /home/user/public_html/php.ini -f /home/user/public_html/file.php