Forum Moderators: coopster

Message Too Old, No Replies

Fatal error: Call to undefined function gd info()

How to access gd lib on compiled php install

         

eflat

11:15 pm on Sep 19, 2007 (gmt 0)

10+ Year Member



Hello, all,
I've inherited the maintaining a website which looks like was set up with a custom compiled install of php. Running gd_info() gives me "Fatal error: Call to undefined function gd_info()"

Is there a way to access GD without recompiling php?

A couple of tasty bits from phpinfo:
'--with-gd=shared'
'--enable-gd-native-ttf'
'--with-freetype-dir=/usr'

Please? Thanks!

And a more complete listing of the configure command from phpinfo:
PHP Version 5.2.3

System Linux linuxcp19334 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686
Build Date Jun 22 2007 15:59:06
Configure Command './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-xml' '--with-expat-dir=/usr' '--with-dom=shared,/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-xmlrpc=shared' '--with-pcre-regex' '--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-ssl' '--with-kerberos' '--with-ldap=shared' '--with-mysql' '--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=/var/www/bin/apxs' '--with-xpm-dir'

cdmn

1:26 am on Sep 20, 2007 (gmt 0)

10+ Year Member



Is GD enabled?

php.ini:

;extension=php_gd2.dll
or
extension=php_gd2.dll
?

If its commented, just uncomment it, save it and restart your HTTP server.

eflat

3:51 am on Sep 20, 2007 (gmt 0)

10+ Year Member



I searched the entire drive -- there's no php.ini -- sucks, eh? Not even in the directories shown in phpinfo.

vincevincevince

5:44 am on Sep 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Shared GD means that you should be installing GD itself separately. Download it from the GD site and it should run okay. You may still need to edit the php.ini file which is probably in /etc/php.ini

eflat

2:05 am on Sep 22, 2007 (gmt 0)

10+ Year Member



There really is no php.ini in /etc. There is however php.ini.rpmsave -- could that be being read by this install?

I did seem to solve my original issue: I loaded the library dynamically in the code via 'dl("gd.so");'

coopster

1:55 am on Sep 23, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, eflat.

A few years ago [webmasterworld.com] I discovered that PHP will run without a php.ini file. Granted, the test was on a Windows platform but I'm fairly certain it will hold true for other platforms as well. To determine if and where your php.ini may be you can run a phpinfo() [php.net] script. To setup a php.ini you need to have a look at the install [php.net] steps for your particular platform. Note: you may be able to determine php.ini location once you browse through the install steps, if one does indeed exist.

eflat

2:35 am on Sep 23, 2007 (gmt 0)

10+ Year Member



Very interesting, Coopster,
phpinfo gives me:
Configuration File (php.ini) Path -- /etc
Loaded Configuration File -- (none)
Scan this dir for additional .ini files -- /etc/php.d
Additionally see my first post for the configure command.

In light of the posting you referenced, I'm more confident in assuming there really is no ini file being read. I wonder what would happen if I added an php.ini file with a single line for adding the gd module? I would think it would still have everything from its configure command plus what was in the ini file.

Unfortunately this is a live, production system, so I don't have alot of leeway to try something out to see what happens. Hmmm...maybe in the wee hours one night......