php output is empty (rrdtool.so)

Bug #677820 reported by Frantisek Dobrota
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
amavis-stats (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: amavis-stats

Description: Ubuntu 10.04.1 LTS
Release: 10.04
amavis-stats:
  Installed: 0.1.22-1

after server update i had to comment out following IF in amavis-stats.php to get stats working by using command line tool

// if (!function_exists('rrd_graph') && !@dl('rrdtool.so'))

Tags: patch
Changed in amavis-stats (Ubuntu):
status: New → Confirmed
Revision history for this message
Ben Johnson (a03-6eo-chg) wrote :

Frantisek, the reason that amavis-stats stopped functioning correctly after applying package updates is that your PHP version was upgraded.

amavis-stats relies on PHP's dl() function, which was removed from some SAPIs in PHP 5.3 (see: http://www.php.net/manual/en/function.dl.php ).

The workaround that you outlined (commenting-out one of the control structures) will have undesirable effects and cause the script to malfunction for embedded PHP configurations (because the $rrd variable will always be set to "command-line").

Instead, the calls to the dl() function should be replaced with calls to the extension_loaded() function, as such:

[...]

if (function_exists('rrd_graph') && !extension_loaded('rrdtool.so')) {
 $rrd = "PHP embedded";
}

if (!function_exists('rrd_graph') && !extension_loaded('rrdtool.so')) {

[...]

Revision history for this message
Ben Johnson (a03-6eo-chg) wrote :

The attached patch file resolves the issues described in this report.

Revision history for this message
Ben Johnson (a03-6eo-chg) wrote :

Slight correction to previously-attached patch file.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch to resolve critical PHP errors in amavis-stats" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.