Background info:
Server: Synology NAS DS2415+
osTicket Version: v1.12 (a076918
Web Server Software: Apache/2.2.34 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
MySQL Version: 10.3.11
PHP Version:5.6.40

Issue:
Like many before me looking at the forums, I am having an issue with my newly installed osTicket, pulling emails from my on-premises Exchange 2013 email server via a CRON job - it works fine using "Fetch Emails using Auto-cron" so all the user account and IMAP+SSL port settings are correct, but obviously I would like it to run, even if there isn't an agent active in the ticket system.

What I have tried:
Adding job to Synology's internal "Task Scheduler" app, with the following setting:
/usr/bin/php /volume1/web/osticket/upload/api/cron.php
/usr/local/bin/php56 /volume1/web/osticket/upload/api/cron.php
/usr/local/bin/php72 /volume1/web/osticket/upload/api/cron.php (after I changed web settings to use PHP 7.2)

Which generates this email:
SUBJECT: osTicket Fatal Error
Unable to connect to the database — No such file or directory https://FQDN:5001/webapi/entry.cgi
Ref-Mid: BqIsXgI-yIdwI-AAAAAAAAAAAAAAAAP0Uzilky-@osTicketMailer

Where FQDN:5001 is my domain and the port the Synology admin runs on.

And I've also tried running the same commands from via SSH, all generate a HTML response of
<b>Fatal Error:</b> Contact system administrator.
and a similar email to above which reads
Unable to connect to the database — No such file or directory http://:volume1/web/osticket/upload/api/cron.php
Ref-Mid: BqIsXgI-71SCL-AAAAAAAAAAAAAAAAP1KpoP9x-@osTicketMailer

So, assuming people have successfully gotten it working on a Synology NAS, what am I missing please?

TIA,
-Stuart.

This could be a number of things.

First the error you are seeing is that it command line php cannot talk to the database.
PHP can have more than one php.ini. A lot of linux based systems have one for the webserver (apache) and one for command line. Seeing as the error says it cannot connect to the database, I would think that this could be caused by the lack of proper extensions being enabled. It perhaps synology uses some custom port for local traffic?

If you look at your PHP or MySQL error logs you should be able to get a better error than the generic cannot connect. You would have to consult your error logs to see whats going on. It possible that they are not enabled... so you might need to enable them and then get the error to trigger again.

Write a Reply...