Execute Cronjob from Web

Tested with 6.1.

Sometimes you couldn't use system cronjobs to run the vtigerCRM Scheduler. But lot's of features need this to work properly.
So you could modify the Cron File to execute the Cronjob over HTTP.
To not open this access point for every one, you need to add the application unique key as parameter and could limit the access to a single or multiple IPs.

File: vtigercron.php

$version = explode('.', phpversion());

Insert After

if(!empty($_REQUEST["unique_key"])) {
    $allowOnlyIP = array("84.189.115.145");
 
    // To get the IP which you need to limit the access, uncomment the next line:
    //var_dump($_SERVER["REMOTE_ADDR"]);
 
    $_SESSION["app_unique_key"] = preg_replace("[^a-zA-Z0-9-.,_;:]", "", $_REQUEST["unique_key"]);
    $_SESSION["authenticated_user_id"] = 1;
 
 
    if(!empty($allowOnlyIP) && !in_array($_SERVER["REMOTE_ADDR"], $allowOnlyIP)) {
        unset($_SESSION["app_unique_key"]);
        unset($_SESSION["authenticated_user_id"]);
    }
}

Now you could call your workflow from a cronjob provider like EasyCron.
(If you use this provider over this link, you support my work in this wiki.)
But it will work absolutely every cronjob provider or function, which could call a URL.

Simple configure a cronjob for this URL:

<domain>/vtigercron.php?unique_key=<your_application_unique_key>

Your <your_application_unique_key> you found in your config.inc.php file in the variable $application_unique_key

Limit access to static IP's

I integrate an access limitation if you only want to grant the access to a single IP's
You see the line
$allowOnlyIP = array();

You could use this Array to set the IP's which could be access this file. If this array is empty, every one, which have your unique key could execute your cronjob!

In the case of EasyCron you could set this variable to:

$allowOnlyIP = array('142.4.201.54', '198.27.81.134');