Contents
Sometimes you need to execute a file, function, lib PHP needs a special version not default in the system. The post guide how to find and run command PHP special version and show the case with some control panel popular.
I. Find location PHP with function phpinfo
Just create a file info.php on your site put code below to the file info.php the access to via browser. Example https://domain.com/info.php
<?php
phpinfo();
Result as example here
Different way you can use command below to find this info:
php -i | grep "Configure Command"
The default something as below/usr/local/php56/bin/php --version
/usr/local/php70/bin/php --version
/usr/local/php80/bin/php --version
or
/usr/local/php56/bin/php-cli --version
/usr/local/php70/bin/php-cli --version
/usr/local/php80/bin/php-cli --version
II. Run multiple PHP in some control panel popular.
1. Cpanel
/usr/local/bin/ea-php56 --version
/usr/local/bin/ea-php70 --version
/usr/local/bin/ea-php80 --version
2. Plesk Panel multiple PHP version
/opt/plesk/php/5.6/bin/php --version
/opt/plesk/php/7.0/bin/php --version
/opt/plesk/php/8.0/bin/php --version
3. Centos Web Panel (CWP)
You your server install multiple PHP version you can run command special follow path
/opt/alt/php56/usr/php/bin/php --version
/opt/alt/php70/usr/php/bin/php --version
/opt/alt/php80/usr/php/bin/php --version
If you use PHP-FPM use command:
/opt/alt/php-fpm56/usr/bin/php --version
/opt/alt/php-fpm70/usr/bin/php --version
/opt/alt/php-fpm80/usr/bin/php --version
4. VestaCp
/usr/bin/php56 --version
/usr/bin/php70 --version
/usr/bin/php80 --version
Continue Update