How do I call a PHP script from the SSH console?
As part of your Flexible Web Hosting, you have the option of using the SSH (Secure Shell) console. HERE you will find a guide on how to activate SSH access on your account.
Sometimes there is a need to call the script directly from the console.
Once you have logged in and navigated to the directory where the script you want to run is located, issue the command:
php your-script.php
similarly, if you want to use a version of PHP other than the default one , e.g. 7.3, you can issue the command:
php73 your-script.php
Please note that the PHP available at the SSH console level is not the same as the PHP version available on the web server where your pages are running, and the PHP interpreter version you select for your website is not related to the currently active and default version at the SSH console level. The default version of PHP on the SSH console is 5.3.
Didn't find an answer?
Our support team is here for you 24/7 – write to us and we will help you sort it out.