← ServerPilot Docs

How to Use the PHP CLI

PHP's Command Line Interface (CLI) allows you to execute PHP scripts when logged in to your server through SSH.

ServerPilot installs multiple versions of PHP on your server so there are multiple PHP executables available to run.

Each of the following commands calls the PHP CLI for a different PHP version:

For PHP 5.6:


For PHP 7.0:


For PHP 7.1:


For PHP 7.2:


For PHP 7.3:


For PHP 7.4:


You can also configure the PHP version used when you call just the command php.

For more information, see the PHP CLI documentation.

Heads up! Your web applications often expect to be invoked through web requests and may not work correctly when invoked from the command line. To run PHP scripts through Cron, it is often best to cron a web request to your site using curl or wget.
Last updated: June 2, 2020

Launch your first site in 5 minutes