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

PHP Errors after installation

Hi,

After installing the latest version of OSTicket, I am getting a number of PHP notices in my server log files.

I then turned on the php error reporting and I am getting the same errors on the admin panel.

Example of errors:
PHP Notice: Undefined variable: dblink in /var/www/html/crm/osticket/include/mysql.php on line 25
[Wed Jan 09 14:49:52 2008] [error] [client 82.] PHP Notice: Undefined variable: dblink in /var/www/html/crm/osticket/include/mysql.php on line 28
[Wed Jan 09 14:49:52 2008] [error] [client 82.] PHP Notice: Undefined index: _staff in /var/www/html/crm/osticket/scp/staff.inc.php on line 55

[Wed Jan 09 14:50:17 2008] [error] [client 82.] PHP Notice: Undefined index: autolock_minutes in /var/www/html/crm/osticket/include/staff/preference.inc.php on line 187, referer: http://path/osticket/scp/admin.php
[Wed Jan 09 14:50:17 2008] [error] [client 82] PHP Notice: Undefined index: reply_separator in /var/www/html/crm/osticket/include/staff/preference.inc.php on line 253, referer: http://path/osticket/scp/admin.php
[Wed Jan 09 14:50:17 2008] [error] [client 82] PHP Notice: Undefined index: default_email in /var/www/html/crm/osticket/include/staff/preference.inc.php on line 269, referer: http://path/osticket/scp/admin.php
Any ideas guys?? Is there a path that is perhaps incorrect, which is causing all of the undefined variables?

Comments

  • PHP error reporting.

    You probably have full error reporting turned on in php.ini. For more info please see http://www.php.net/error_reporting

    I would recommend you turn off notices system wide in php.ini. If that is not possible then you need to edit main.inc.php as shown below.

    change
    //error_reporting(E_ALL ^ E_NOTICE); //Respect whatever is set in php.ini (sysadmin knows better??)


    to
    error_reporting(E_ALL ^ E_NOTICE); //Respect whatever is set in php.ini (sysadmin knows better??)
  • Ok, so initially I had the php error reporting turned off in the main.inc.php, but then I had some problems with setting up the pop3 email fetching using a cron job. So, to debug I tailed my logs and found all of these errors.

    Then I turned error reporting on in the main.inc.php, but turned it off again because of all of the notices.

    Surely, it is not a solution to just turn off error reporting - I mean, that is just hiding the problems and not fixing them. Are these bugs always present in the software?
  • Wow! I guess you are new to PHP. It is a language for the lazy! Unlike C, you don't have to defined variables before you use them. Download any app and you will always see the notices unless of course all variable are defined. No one does it for the most part.

    error_reporting(E_ALL ^ E_NOTICE); simply tells the system to ignore notices and ini_set('display_errors',0); tells the system to log the errors to file instead of displaying them to the end user.


  • Reply

    Ok, I understand what you're saying. I am not that new to php though, but learned how to code using other languages - where those principles are pretty much standard.

    Anyway, other than that, the software is running fine and it is exactly what I need, but I am having some issues with setting up the email accounts - not sure if you can help me with this though?

    I've got the php-imap package installed and the cron job running, but it still doesn't seem to be working. Thoughts?
  • I am a C developer myself. What you get away with in PHP sometimes feels like murder!

    For cron issues please check http://osticket.com/forums/showthread.php?t=138
Sign In or Register to comment.