Jump to content


Photo

GD not loaded though compiled, resulting in "Call to undefined function"


  • Please log in to reply
6 replies to this topic

#1 czamora

czamora
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 24 July 2006 - 08:17 PM

Hi,

My current php installation (version 4.3.9) was built with GD:

--with-gd=shared --enable-gd-native-ttf --without-gdbm

but when I try to use any GD functions I get:

PHP Fatal error:  Call to undefined function:  imagefontheight()

GD is installed on my system (Linux Centos 4.3), as indicated by yum, and by the fact that Webmin uses it.

I have tried loading it as an extension, by including the line
extension=libgd.so
in a file inside /etc/php.d, but it does not find that library. If I link /usr/lib/php4/libgd.so to the actual library file in /usr/lib/libgd.so.2, then it complains that the file is not a php extension library.

I don't know what else to do, or what can be wrong.

Any help will be greatly appreciated.

get_loaded_extensions() gives:
Array
(
    \[0] => yp
    [1] => xml
    [2] => wddx
    [3] => tokenizer
    [4] => sysvshm
    [5] => sysvsem
    [6] => standard
    [7] => sockets
    [8] => shmop
    [9] => session
    [10] => pspell
    [11] => posix
    [12] => pcre
    [13] => overload
    [14] => mime_magic
    [15] => iconv
    [16] => gmp
    [17] => gettext
    [18] => ftp
    [19] => exif
    [20] => dio
    [21] => dbx
    [22] => dba
    [23] => curl
    [24] => ctype
    [25] => calendar
    [26] => bz2
    [27] => bcmath
    [28] => zlib
    [29] => openssl
    [30] => apache2handler
    [31] => mysql
)

The complete ./configure options for php were:

./configure --build=i686-redhat-linux-gnu --host=i686-redhat-linux-gnu --target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --enable-force-cgi-redirect --disable-debug --enable-pic --disable-rpath --enable-inline-optimization --with-bz2 --with-db4=/usr --with-curl --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --with-gd=shared --enable-gd-native-ttf --without-gdbm --with-gettext --with-ncurses=shared --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-png --with-pspell --with-xml --with-expat-dir=/usr --with-dom=shared,/usr --with-dom-xslt=/usr --with-dom-exslt=/usr --with-xmlrpc=shared --with-pcre-regex=/usr --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --enable-sysvsem --enable-sysvshm --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-pear=/usr/share/pear --with-imap=shared --with-imap-ssl --with-kerberos --with-ldap=shared --with-mysql=shared,/usr --with-pgsql=shared --with-snmp=shared,/usr --with-snmp=shared --enable-ucd-snmp-hack --with-unixODBC=shared,/usr --enable-memory-limit --enable-shmop --enable-calendar --enable-dbx --enable-dio --enable-mbstring=shared --enable-mbstr-enc-trans --enable-mbregex --with-mime-magic=/usr/share/file/magic.mime --with-apxs2=/usr/sbin/apxs



#2 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 24 July 2006 - 08:21 PM

What does this show?

<?php
var_dump(gd_info());
?>

Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#3 czamora

czamora
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 26 July 2006 - 10:34 AM

I'm afraid trying to call that method also produces the same result:

PHP Fatal error:  Call to undefined function:  gd_info()


#4 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 26 July 2006 - 01:53 PM

Are you sure your configure went ok? Did you tee the configure and make processes and check for errors? Are you sure you ran make install if you happen to be upgrading? (I've forgotten this before.) Where is libgd.so located?
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#5 czamora

czamora
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 26 July 2006 - 09:30 PM

Well, I don't know if the configure went ok, because it was done by the company hosting my server. I think they have a standard image that they copy to new servers, so they probably did not compile php directly on my server. And in fact, they probably never compiled it anywhere, but installed it from a binary distribution (with 'yum install php').

Regarding the location of libgd.so, these are the files I found:
/usr/lib/libgd.so.2
/usr/lib/libgd.so
/usr/lib/libgdbm.so.2
/usr/lib/libgd.so.2.0.0
/usr/lib/libgdbm.so.2.0.0

of which /usr/lib/libgd.so and /usr/lib/libgd.so.2 are links to /usr/lib/libgd.so.2.0.0

Any ideas?


#6 czamora

czamora
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 30 July 2006 - 10:59 PM

Any hints, anyone?

#7 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 31 July 2006 - 02:09 PM

I would contact your hosting company since they did the installation. Show them a simple test case that fails, such as the gd_info.
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users