php output is empty (rrdtool.so)
Bug #677820 reported by
Frantisek Dobrota
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_
Changed in amavis-stats (Ubuntu): | |
status: | New → Confirmed |
To post a comment you must log in.
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')) {
[...]