Skip to main content

Cron/Scheduled Tasks

In order for some phpVMS features to work, a cronjob is required to be setup. Some of the features that rely on cronjobs include:

  • Job queue tasks (sending emails, notifications)
  • Finances
  • vaCentral features

If you can't run it once a minute, the lowest interval possible is fine, but should be in 5 minute increments, since there are tasks that run at 5,15, and 30 minute intervals.

Configuration on a Server

If you have SSH and crontab access, this is the easiest way to configure the cron job. You need the path to the bin/cron file that's in the root of the phpVMS install. After that, add a cronjob that runs once a minute. Do not forget to include the username, for example, using crontab -e:

* * * * * php /path/to/phpvms/bin/cron >> /dev/null 2>&1

If your server has access to proc_open, you can also use the Laravel schedule runner:

* * * * * php /path/to/phpvms/artisan schedule:run >> /dev/null 2>&1

cPanel Configuration

phpVMS, in the admin panel, can suggest a cron path/command for you, under Admin -> Maintenance. However, before trying that, try setting it up according to your host's instructions.

Note the "Domain Specific Example"

Many hosts offer multiple PHP versions, make sure to use the path to the PHP 7.x version in the cronjob. Contact your host! Point them to this page. The example below uses PHP 7.4.

With cPanel, select "Once Per Minute" under "Common Settings", and you can use a similar command.

/usr/local/bin/ea-php74 -q /your/path/to/phpvms/bin/cron

Web Cron

If you're unable to use the cron on your server, or want an easier setup, you can use the web cron. To enable it, go to Maintenance in the admin panel. It's disabled by default:

Clicking the enable button gives a URL that can be used in the web-cron service to hit:

This URL can also be reset as the ID at the end if generated by random, for security purposes.

Guides on setting up a cron job