I used rcron.php and api_ticket_create.php and I noticed something strange. For example for rcron.php. I had to modify the url
'url'=>'http://yourdomain.com/support/api/tasks/cron'
to
'url'=>'http://yourdomain.com/support/api/http.php/tasks/cron'

Otherwise if I don't add the 'http.php' the return from curl_exec($ch); is
(.*) Server: Apache X-Powered-By: PHP/5.6 File not found.

I solved the same issue for api_ticket_create.php by also adding http.php

There is many discussions around the error "File not found" I think it could help other people..

@Francois

Yes, if your URL rewriting is not working correctly then you will have to use the http.php extension. This is indicative of URL Rewriting not working correctly on your server, at least for this specific URL.

The way it should work is that you call api/tasks/cron and api/.htaccess should rewrite the URL to api/http.php/tasks/cron for you. Take a look at api/.htaccess for yourself.

Cheers.

    Ok I understand... Is it possible to add a comment at the beginning of files api_ticket_create.php and rcron.php?
    (A comment who explain it)
    I think many many people are not aware that the Url must be rewritted by an .htaccess file.

    regards
    Thank you for your help

      osTicket comes with the .htaccess that does the re-write... its in the /api folder. so I'm not sure that a comment would be necessary.

      Anita, thank you for the Tip, finally the problem was due to the .htaccess file. The file is existing but something is wrong with my server and htaccess.files. I finally solved the issue by adding http.php into the url. It's working perfectly now. The cron is now started by our WordPress website.

      a year later
      Write a Reply...