Introduction
When troubleshooting scripts, it is often necessary to run PHP scripts via the command line. This article provides the procedure to run a PHP using the same version the user's site uses.
Procedure
- Log into the cPanel user's cPanel.
- Open the "MultiPHP Manager" interface in the "Software" section of cPanel.
- Note the PHP version used by the site.
- Click the "Tools" link from the left-side menu.
- Open the "Terminal" interface in the "Advanced" section of cPanel.
- Read the warning and click the "I understand and want to proceed." button.
- Change to the directory that the script is in.
cd /home/$username/path/to/script/folder
Please note that "/home/$username/path/to/script/folder" must be replaced with the full path to the script's folder. - Execute the script using the full path to the
php
executable.- ea-php
/opt/cpanel/ea-phpXX/root/usr/bin/php script.php
- alt-php
/opt/cloudlinux/alt-phpXX/root/usr/bin/php script.php
- ea-php
Comments
0 comments
Article is closed for comments.