Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

rcron. php not work

befor sorry for my bad englisch.

I have a Problem with the cron job.
My Hoster allows only http to starts the job.

The i have to use the rcron.php is this right?
I put this in my root directory and give him 777 right.

Then i create a API Key with the IP from the Server and i markt both options.

This API key i insert in the rcron.php

#!/usr/bin/php -q

PHP script used for remote cron calls.

Peter Rotich <>
Copyright (c) 2006-2013 osTicket

Released under the GNU General Public License WITHOUT ANY WARRANTY.
See LICENSE.TXT for details.

vim: expandtab sw=4 ts=4 sts=4:

# Configuration: Enter the url and key. That is it.
# url => URL to api/task/cron e.g
# key => API's Key (see admin panel on how to generate a key)

$config = array(

function_exists('curl_version') or die('CURL support required');

#set timeout

#curl post
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $config['url']);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '');
curl_setopt($ch, CURLOPT_USERAGENT, 'osTicket API Client v1.7');
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Expect:', 'X-API-Key: '.$config['key']));

if(preg_match('/HTTP\/.* ([0-9]+) .*/', $result, $status) && $status[1] == 200)

echo $result;

But it not work.
I get a feedback from the Server:

#!/usr/bin/php -q HTTP/1.1 404 Not Found Date: Wed, 10 Apr 2013 19:00:01 GMT Server: Apache Vary: Accept-Encoding Content-Length: 219 Content-Type: text/html; charset=iso-8859-1 
Not Found
The requested URL /support/api/task/cron was not found on this server.

What is wrong?


  • The same problem...


    We have exactly, the same problem.

    I have 1.7.0 rel. with CentOS 6.4, PHP 5.3.3, Apache 2.2.15. php_imap 5.3.3.

    Mail POP configured.

    We have generated API key using same IP address of osTicket Host, an put it in rcron.php.

    $config = array(

    I've create crontab task calling configured rcron.php (entry in /etc/crontab file).

    */1 * * * * root /usr/bin/php -q /var/www/helpdesk/scripts/rcron.php

    But dont work.

    If I execute cron task manually, I got this message:

    [HTML]The requested URL /support/api/task/cron was not found on this server[/HTML]

    Can you help me?

    thansk in advance.
  • Sorry, i've made mistake.

    In rcron.php I put this

    $config = array(

    And show error message:

    The requested URL /support/api/task/cron was not found on this server

    But if I put:

    $config = array(

    No error show, but don't work.

    Any help will be apreciatted...
  • rcron.php is for remote cron calls. The url in should be

    In your case, you can use local cron call as shown below - without the need to setup any API Keys.

    */1 * * * * root /usr/bin/php -q /var/www/helpdesk/api/cron.php
  • Solved


    Thanks for all.

    I've changed cron task with this line:

    [HTML]*/1 * * * * root /usr/bin/php -q /var/www/helpdesk/api/cron.php[/HTML]

    Also, i've cleaned all API keys and restore original rcron.php file.

    And now all work fine.

    Thanks again!!
  • Hi Peter,
    can you explain me what is wrong with my rcron?
  • Doc;37489 said:
    Hi Peter,
    can you explain me what is wrong with my rcron?
    The url in rcron.php need to be /support/api/tasks/cron
  • same problem, same error
Sign In or Register to comment.