php-gd installed but not working!

Discussion in 'Programming/Scripts' started by cooljai, May 19, 2007.

  1. cooljai

    cooljai New Member

    Hi,

    After striking my head here n there for hours, Im finally posting the problem here in hope for solution. I saw recent thread stating compilation of php with gd, but why I started new thread is that here php-gd is seems installed but not working. I apologies if I'm not following rules.

    Im using CentOS 4.4, here is output of 'uname -a':

    Linux server1.example.com 2.6.9-42.0.10.ELsmp #1 SMP Tue Feb 27 09:40:21 EST 2007 x86_64 x86_64 x86_64 GNU/Linux

    I've installed php, php-gd successfully via yum install php php-gd.
    Here's output of 'rpm -qa | grep php':

    php-devel-5.1.6-3.el4s1.5
    php-5.1.6-3.el4s1.5
    php-cli-5.1.6-3.el4s1.5
    php-common-5.1.6-3.el4s1.5
    php-gd-5.1.6-3.el4s1.5

    It seems that php-gd is installed, but running page which contains its functions throwing error like:

    Fatal error: Call to undefined function: imagecreatetruecolor() in /var/www/html/image_resize.php on line 13


    There's no php-gd information in phpinfo output.

    Please help to resolve issue...

    Thanks

    Jai
    ---------
    ek chota mota hindustani
    ---------
     
  2. Ben

    Ben Active Member Moderator

    can you check wether you find the line

    in either /etc/php.ini or any file in /etc/php.d ?

    If you run
    php -v

    you should find the lines
    Also you should find sth like "--with-gd=shared" in the configure command output of php -v

    If so, did you restart your apache after installing the php modules?
     
  3. cooljai

    cooljai New Member

    Still not installed

    Hi,

    thanks for reply. I've found "extension=gd.so" in /etc/php.d/gd.ini
    here is the output of php -v

    Code:
    PHP 4.4.6 (cli) (built: May 11 2007 14:03:44)
    Copyright (c) 1997-2007 The PHP Group
    Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
    I've restarted Apache.

    After getting no success with Yum install php php-gd (although it installed, but not running) I tried to compile it on myself.

    Even in source compilation, there were so many errors ( like libjpeg.so not found, even after decteting its directory). That's was a bug in php http://bugs.php.net/bug.php?id=33685&edit=1

    After taking precautions as described in bug page, I got cheers!! PHP is installed with GD.


    Jai
    - - - -
    ek chota mota hindustani
    - - - -
     
    Last edited: May 21, 2007

Share This Page