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

How to add a domain / website for hosting

To add a domain for hosting, please do the following: Login to the control panel (please see...

How to create subdomains? (sub.domain.com)

To add a subdomain, please do the following: Login to the control panel -- please see...

Where do I upload files for the web site? (public_html)

Hsphere has a true separate domain setup and as such there isn't a central "public_html" folder...

How can I test my site before changing DNS? (instant aliases)

To test your site before changing the DNS nameservers, you can use the instant access alias that...

Hsphere User Guides

User guides for our hsphere control panel are available at our downloads section for user guides:...