Ubuntu lucid /php 5.3.2 breaks cacti

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
boran11
Posts: 27
Joined: Mon Mar 21, 2005 8:52 am

Ubuntu lucid /php 5.3.2 breaks cacti

Post by boran11 »

Hi,

I had a hardy/804 cacti running and just upgraded to Lucid, which upgraded PHP 5.3.2 and Cacti to 0.8.7e.

According to the FAQ to ignore the many deprecated PHP warnings one should add to /etc/php5/apache2/php.ini
error_reporting = E_ALL & ~E_DEPRECATED

or to /usr/share/cacti/site/include/config.php
error_reporting(~E_DEPRECATED);

I tried both and restarted Apache, but it stubbornly continues to show for example:
Deprecated: Function ereg() is deprecated in /usr/share/cacti/site/lib/html_validate.php on line 38

And in /var/log/apache2/error.log
<br />
<b>Warning</b>: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in <b>Unknown</b> on line <b>0</b><br />
<br />
<b>Warning</b>: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in <b>Unknown</b> on line <b>0</b><br />
<br />
<b>Warning</b>: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in <b>Unknown</b> on line <b>0</b><br />
<br />
<b>Warning</b>: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in <b>Unknown</b> on line <b>0</b><br />
<br />
<b>Warning</b>: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in <b>Unknown</b> on line <b>0</b><br />

Am I missing something obvious? Sorry if this is a FAQ..
Sean
beandip
Posts: 9
Joined: Thu Nov 17, 2005 2:14 pm

Post by beandip »

From http://forums.cacti.net/viewtopic.php?t=36427
browniebraun wrote:For all of you using PHP 5.3:

Edit your php.ini and set error_reporting to:

Code: Select all

error_reporting = E_ALL & ~E_DEPRECATED
After that edit /cacti/include/global.php and change line 196 from

Code: Select all

error_reporting(E_ALL);
to

Code: Select all

error_reporting(E_ALL ^ E_DEPRECATED);
Do exactly the same in line 312 of file adodb-time.inc.php located in /cacti/lib/adodb

Now restart your web server and you will see that all "deprecated" messages will be successfully suppressed.
That was a little older because the line numbers were not the same but it fixed my Cacti 0.8.7e on Ubuntu Lucid.
boran11
Posts: 27
Joined: Mon Mar 21, 2005 8:52 am

Post by boran11 »

That worked for me, thanks.
The precise files diffs (for future reference with Lucid) in my case were:

Code: Select all

diff -r1.1 /usr/share/php/adodb/adodb-time.inc.php
442c442,443
<       error_reporting(E_ALL);
---
>       #error_reporting(E_ALL);
>       error_reporting(E_ALL ^ E_DEPRECATED);

diff -r1.1 /usr/share/cacti/site/include/global.php
181c181,182
< error_reporting(E_ALL);
---
> #error_reporting(E_ALL);
> error_reporting(E_ALL ^ E_DEPRECATED);
Sean
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Should be solved by 087g beta1, just in case you want to verify
R.
boran11
Posts: 27
Joined: Mon Mar 21, 2005 8:52 am

Post by boran11 »

Thanks, I'm trying to stick with the Ubuntu packages for this particular instance (easier long term support)

I've opened a bug on launchpad for the lucid package, I'm hoping they'll patch it as I believe it will affect all Lucid users...
https://bugs.launchpad.net/ubuntu/+sour ... bug/589543
Sean
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

They will likely switch to 087g at some point in time :wink:
R.
basd
Posts: 5
Joined: Mon Aug 18, 2008 2:02 am

Post by basd »

beandip wrote:From http://forums.cacti.net/viewtopic.php?t=36427
browniebraun wrote:For all of you using PHP 5.3:

Edit your php.ini and set error_reporting to:

Code: Select all

error_reporting = E_ALL & ~E_DEPRECATED
After that edit /cacti/include/global.php and change line 196 from

Code: Select all

error_reporting(E_ALL);
to

Code: Select all

error_reporting(E_ALL ^ E_DEPRECATED);
Do exactly the same in line 312 of file adodb-time.inc.php located in /cacti/lib/adodb

Now restart your web server and you will see that all "deprecated" messages will be successfully suppressed.
That was a little older because the line numbers were not the same but it fixed my Cacti 0.8.7e on Ubuntu Lucid.

This is not a solution but a workaround!!!

the command ereg wil be taken out of php then cacti wil stop functioning so its stil a BUG!!!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Correct.
So we already removed a lot of them in 087g as well. And current SVN/main is completely free of deprecated code (at the time of writing)
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests