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

Error fetching Emails via cron

Hey there,

i installed a fresh Ubuntu 16 LTS and withPHP5.6 in addition to PHP7. 7 is deactivated via a2dismod php7.0. Everything (i mean everything) works except fetching emails via cron. When i switch to manually grab them while a agent is logged on everything is fine. I started the cron manual to see what happens and besides a few PHP Notice message i get:

PHP Fatal error:  Cannot declare class Error, because the name is already in use in /var/www/html/include/class.error.php on line 45

For fun i renamed the class to error1 which causes the site to stop working, but the cron kicks in till it dies because of the whole site is not working. I googled the whole issues but couldnt find a solution.

I am using SMTP, but sending isnt the problem.
Fetching via IMAP but POP didnt make a difference.

If you need additional information about the setup let me know. 

greetings Daniel

Comments

  • edited July 2016
    You have not provided us with enough information to answer your questions.  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.

    Additionally osTicket does not support PHP7 at this time.
  • edited July 2016
    Hey ntozier,

    thanks for your reply. i have read this topic already and thought i posted all related info, let me quick copy and paste it again:

    PHP Error log entries or displayed errors. (you of course may remove any identifying information)

    PHP Fatal error:  Cannot declare class Error, because the name is already in use in /var/www/html/include/class.error.php on line 45

    Mail Sending: phpMail functions or SMTP

    SMTP

    Mail Fetching/Receiving: IMAP or POP and Server version

    I am using SMTP, but sending isnt the problem.
    Fetching via IMAP but POP didnt make a difference.

    PHP version

    5.6

    Operating System

    Ubtuntu 16.04 LTS

    Client or Staff side of the UI

    I am manually calling the cron from comandline

    the location - the url or what your clicking on that is causing the problem.

    whoooops... missed that one:  php /var/www/html/api/cron.php

    screen shots or mock ups showing what you are talking about



    greetings
  • "PHP 5.6"
    Which version of PHP 5.6?

    "manually calling the cron from comandline"
    Whats the command that you are using?


  • edited July 2016
    PHP version is: 5.6.23-2+deb.sury.org~xenial+1


    to test the cron i used: "php /var/www/html/api/cron.php"

  • If you have two versions of PHP installed that command will use PHP 7.  You will need to specifcy the path to PHP 5.6
  • edited July 2016
    thx ntoizer, that did the trick, i was thinking while 7.0 is unloaded it would pick the right one.

    # php5.6 /var/www/html/api/cron.php

    does it. thanks a lot!
  • It might be that you have "too much" path in your -f parameter. Works for me with: 
    */2 * * * *    apache    /usr/bin/rake -s -f /path/to/redmine/Rakefile redmine:email:receive_imap RAILS_ENV="production" $OTHER_OPTIONS
Sign In or Register to comment.