poum has asked for the wisdom of the Perl Monks concerning the following question:

I have a lot of trouble with scripts using GD: sometimes, everything ok, other no image or non achieved images, but only under MP2. With MP1 or without, no trouble. Has a wise monk heard something about that ? PS: and no error message anywhere !

Replies are listed 'Best First'.
Re: Strange things with MP2 and GD
by liz (Monsignor) on Jan 18, 2004 at 17:22 UTC
    ...and no error message anywhere !

    Not even in the Apache error log? Not even a message about a segfault? Are you sure?

    Also, you forgot to mention which OS you're using. That may also have to do with the observed phenomena.

    Liz

      Apache logs were the first place I searched ! But really nothing at all ! My server is a 2.4.22 Linux one, Apache 2.0.48 with mod_ssl, mod_php (sorry !), mod_perl and mod_auth_pg. All my scripts using GD have the same erratic behavior. When started off-line, images are correctly generated but not trough Apache invocation...
        So it's a path problem (loading wrong library)?
Re: Strange things with MP2 and GD
by dragonchild (Archbishop) on Jan 19, 2004 at 04:15 UTC
    I have had no problems using MP2 (ModPerl::Registry) and GD (well, Graph::Template, which uses GD::Graph which uses GD). I have a production site using it right now.

    What sort of debugging have you done? Have you correctly set the content-type? That kind of stuff (if I remember correctly) changed slightly between MP1 and MP2 (well, Apache1 and Apache2, but same difference).

    ------
    We are the carpenters and bricklayers of the Information Age.

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

      I have solved my problem by recompiling Apache without PHP and GD works now without trouble. So I think, it's effectivly a library path problem with the original gd library used by GD and an another one added by PHP install process (with gd support). Why does GD works correctly sometimes still a great mystery for me ... What kind of debugging could I try ? I have only checked Apache logs. Thanks all for your help (and for Graph::Template that I will try soon !)
        To end with that, the problem is effectively a lib one. PHP module has is own libgd version which is used when configure is invoked with '--with-gd'. So, when a CGI Perl invokes GD, some strange things occures.

        To avoid that without suppress PHP or PHP gd support, it's necessary to pass to configure '--with-gd=<path>' where <path> points to system directory where is the gd include directory and the libgd file. For me, I've used '--with-gd=/usr'.

        And no more strange things !

        Thanks again

        --

        poum