Command to run a PHP Script via Cron

If you want to run a PHP script via cron, you would do the following command:

PHP5.2
/hsphere/shared/php5/bin/php-cli ~/cronfile.php 

PHP 5.3:
/hsphere/shared/php53/bin/php-cli ~/cronfile.php

PHP 5.4
/hsphere/shared/php54/bin/php-cli ~/cronfile.php

PHP 5.5
/hsphere/shared/php55/bin/php-cli ~/cronfile.php

NOTE: ~/ puts you in to your user directory, the one that holds all your domain directories.  So, you would simply add to ~/ to get the path to the file you need to run
  • 980 Users Found This Useful
Was this answer helpful?

Related Articles

Which PHP versions do you support on shared hosting?

We currently support the following PHP versions on our shared hosting servers: 5.6 7.1 7.2...

Selecting PHP version

Selecting PHP versions can be done by doing the following:hsphere Login to the control panel...

How to add custom DNS records

You may need to use DNS records for services else where, such as email via gmail.  To setup those...

Setup Spamexperts - hsphere

THIS NO LONGER APPLIES.   To setup spamexperts within the hsphere control panel...

Aliasing Domains with Proper SEO (domains and Search Engines)

Aliasing a domain to a primary domain is a great way to simplify domain hosting as only one main...