forum.coppermine-gallery.net

Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: Joachim Müller on September 06, 2004, 09:48:15 am

Title: Incorrect GD version display in debug output
Post by: Joachim Müller on September 06, 2004, 09:48:15 am
Casper has reported this issue before (I can't find the thread where he reported this issue): apparently for more recent versions of php than I have access to the GD info in debug_output didn't work - it used to display "GD module not found", although it actually existed on the server. I tried to apply a fix (check out the devel branch), but I'm not sure if it works (as I don't have access to more recent versions of PHP than 4.3.3, and I can't upgrade the existing installs). Please test and mark this thread as fixed if it works for you. Thanks.

Joachim
Title: Re: Incorrect GD version display in debug output
Post by: Casper on September 06, 2004, 10:29:26 am
Hi Joachim,

this was first reported here (http://forum.coppermine-gallery.net/index.php?topic=4319.0),
and discussed here (http://forum.coppermine-gallery.net/index.php?topic=8159.msg36128#msg36128), and by subsequent pm.
Thought it was fixed, but will retest.
Title: Re: Incorrect GD version display in debug output
Post by: Casper on September 06, 2004, 10:41:14 am
Well, I was wrong it's not fixed.

The problem is this.

The debug output shows;
Quote
Module: gd
------------------
module doesn't exist
==========================
Module: mysql
------------------
module doesn't exist


This is of course incorrect, both modules exist and are in use.  The phpinfo accessed through admin tools is correct.

The server this happens on uses php version 4.2.2.  This only appears to happen for GD1, if GD2 then it works correctly.
Title: Re: Incorrect GD version display in debug output
Post by: Joachim Müller on October 23, 2004, 11:28:58 am
Casper, you sent me your phpinfo html output the other day so I could look into this. Could you send it once again please? Thanks.

Joachim
Title: Re: Incorrect GD version display in debug output
Post by: Casper on October 23, 2004, 11:53:38 am
Hi Joachim,

here is a copy of the output, as displayed i the debug info.
Title: Re: Incorrect GD version display in debug output
Post by: Joachim Müller on October 24, 2004, 03:30:10 pm
hrm, I should have specified this even more: I need the html output that get's generated if you actually run a phpinfo file on your server (<?php phpinfo(); ?>), as the debug output uses the module definition in php if it exists - if it doesn't, it falls back to the html output from phpinfo that is being flushed into a var and then checked for existance of some patterns. As I will have to adjust those patterns, I need the actual html output (not just plaintext).

Joachim
Title: Re: Incorrect GD version display in debug output
Post by: Casper on October 24, 2004, 09:13:08 pm
Attached file is the full html source code for the info.php
Title: Re: Incorrect GD version display in debug output
Post by: Joachim Müller on December 28, 2004, 09:23:32 am
just bumping this thread to the first page - will have to look into this issue (self-assign).

Joachim
Title: Re: Incorrect GD version display in debug output
Post by: Casper on December 28, 2004, 12:18:35 pm
I can't figure this out.  But I would put this at the bottom of the list for jobs needed doing, as we know about it, and the info given from the admin tools phpinfo is correct, can we just not mark this as a known issue for now, and ask users to get their info from admin tools.
Title: Re: Incorrect GD version display in debug output
Post by: Joachim Müller on March 01, 2005, 08:01:40 am
I committed to the devel branch of the cvs these changes:
Quote
function cpg_phpinfo_mod($search)
{
    // this could be done much better with regexpr - anyone who wants to change it: go ahead
    ob_start();
    phpinfo(INFO_MODULES);
    $string = ob_get_contents();
    $module = $string;
    $delimiter = '#cpgdelimiter#';
    ob_end_clean();
    // find out the first occurence of "<h2" and throw the superfluos stuff away
    $string = stristr($string, 'module_' . $search);
    $string = eregi_replace('</table>(.*)', '', $string);
    $string = stristr($string, '<tr'); // changed '<tr>' to '<tr', as older versions of php had the table row formatted by html means
    $string = str_replace('</td>', '|', $string);
    $string = str_replace('</tr>', $delimiter, $string);
    $string = chop(strip_tags($string));
    $pieces = explode($delimiter, $string);
    foreach($pieces as $key => $val) {
        $bits[$key] = explode("|", $val);
    }
    return $bits;
}
Casper, could you please check and confirm, so I can add this to the stable branch as well? Thanks

Joachim
Title: Re: Incorrect GD version display in debug output
Post by: Joachim Müller on March 04, 2005, 09:32:17 am
*bump*
Casper, could you please test this?

Joachim
Title: Re: Incorrect GD version display in debug output
Post by: Casper on March 04, 2005, 05:52:56 pm
Sorry for the wait, I'd all but stopped testing on that server.

Yes, your changes work fine, the info is now given correctly, thanks.