error PHP Deprecated: mysql_escape_string():

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
dperezgestyde
Posts: 2
Joined: Wed Dec 27, 2017 9:20 am

error PHP Deprecated: mysql_escape_string():

Post by dperezgestyde »

good morning
Recently update my NagiosXi to version 5.6.7
Now the reports menu takes a long time to load.
Looking at the logs I find this:

PHP Deprecated: mysql_escape_string (): This function is deprecated; use mysql_real_escape_string () instead. in /usr/local/nagiosxi/html/includes/db.inc.php on line 372, referr: https: //IP/nagiosxi/includes/components/nocscreen/noc.php

Please can you tell me how to fix it?
thanks greetings
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: error PHP Deprecated: mysql_escape_string():

Post by scottwilkerson »

This is actually just a test in the software to see if the function is available

Code: Select all

// If we can't use mysql_escape_string then we have to
// just add slashes since we have no open connection
if (function_exists('mysql_escape_string')) {
    $escaped = mysql_escape_string($in);
} else {
    $escaped = addslashes($in);
}
Also, this will not affect reporting performace.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
dperezgestyde
Posts: 2
Joined: Wed Dec 27, 2017 9:20 am

Re: error PHP Deprecated: mysql_escape_string():

Post by dperezgestyde »

Good morning ok
And then why does the error appear when I try to get a report?
and because the reports take so long, more than 5 minutes for the report of the day.
Greetings
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: error PHP Deprecated: mysql_escape_string():

Post by scottwilkerson »

I'm not sure what report you are having problem with but the above line was referred by the Operations Screen

Code: Select all

referr: https: //IP/nagiosxi/includes/components/nocscreen/noc.php
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked