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

cron.php on MacOS (OSX)

Hi Guys,

I'm currently using Autocron for mail fetching, but there are many times when I'm too busy to browse around (show activity on the site) to activate Autocron.
Tried to set up cronjob, but I just cannot get it to work. Note that mail and osTicket resides on the same host.

I have specified the right php and cron.php path, yet I still get a wacky fatal error "<b>Fatal Error:</b> Contact system administrator.hostname:api user$" when i run /usr/bin/php /path/to/cron.php

Can anyone help me with this?

Comments

  • How is your cron configured mate? It seems like it should be the same as Linux servers.
  • Please help us to help you by reading and following the posting guidelines located in this thread: Please read before requesting assistance.  The more information you give us the better we will be able to assist you. Thank you.

    No osTicket version.
    What is your exact cron call and how are you running cron?
    What version of PHP are you running?
    HAve you consulted your PHP error logs?
  • Sorry for the lack of information.
    Also it will assist those you are requesting help from if you can include any of the following when it is pertinent:
    • PHP Error log: NONE
    • osTicket version: v1.10 (up to date)
    • Mail Fetching/Receiving: IMAP NONE
    • PHP version: 5.5.38
    • Operating System: macOS Sierra v10.12.5
    I don't think its actually a cron issue because when I run "/usr/bin/php /path/to/cron.php", i get the error: "<b>Fatal Error:</b> Contact system administrator.hostname:api user$" in the command line.
  • Fatal Errors like that usually indicate that there is a DB connection issue.  And always result in a logged error.  You have a PHP error log, it might be shared with Apache so you will want to locate where you are logging your errors to and see what else it says about the problem.  With out it we are blindingly stabbing in the dark.
  • CLI errors don't log to Apache.. db though, good thinking.

    Could also be a difference of config between Apache and command line php.ini's, on my boxes they are different, but not fatal error different. You able to run other cli php scripts?

    But if you're not fetching or sending email, then what do you need cron for?

    Could you share the actual cron line?

    They user$ bit at the end makes me think you're passing a parameter to the script, or running as nobody but requiring a specific user, or trying to run as www-data/apache etc, however that user can't run scripts (no shell etc in /etc/login).
  • Guys... I feel so stupid. Was using the wrong cli php version.

    Thanks so much for pointing that out Grizly. You da man!


  • All good mate, it's not stupid to miss something in a complicated system, you got there. :-)
  • Thanks for not belittling me haha!
    Not sure if you're part of the osticket support team, but you really deserve a medal (no sarcasm intended).
  • I'm just a user mate. Appreciate your comments, thanks! :-)
Sign In or Register to comment.