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 create a mailbox

To create mailbox within hsphere (the control panel), please do the following:Login to the...

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...

Microsoft Outlook 365 DNS SRV Records

When adding SRV records in hsphere for Microsoft 366, the fields under the DNS configuration new...

Giving limited access to developers

In hsphere you can create users for FTP and mysql so that you can limit access to content and...

Hsphere User Guides

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