Linux-Noob Forums

Full Version: gd not being recognised
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

I'm up to making on the fly images with php in the book im using, but something is wrong because i can't get it working. I tried using gd_info() but got the following error.



Code:
[client 64.3.38.60] PHP Fatal error:  Unknown function:  gd_info() in /var/www/html/pathtophpfile/pathtophpfile/gdcheck.php on line 2, referer: http://undergroundinfection.net/pathtophpfile/phpjunk/




 

so i checked phpinfo() and it looks like gd is in there but its not acting like it.



Code:
Configure Command   './configure' '--build=i386-redhat-linux' '--host=i386-redhat-linux' '--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-pic' '--with-apxs2=/usr/sbin/apxs'




any ideas or thoughts on what i might be doin wrong or how to go about getting it to work properly? I'm pretty sure my php is rpm installed so if i have to recompile i'm kinda screwed.


Quote:PHP Fatal error:  Unknown function:  gd_info()
Indeed no gd found, thus no gd installed. 

Quote:--with-gd=shared
 

Shared, i.e. external gd lib, so you need gd installed. If it is you can add:

 

Quote:--with-gd=shared,/path/to/lib
 

Oh.. RPM installed... hrmm, well I hope its just that the GD library is simply not in its dependencies then.

so how do i tell php where to find the gd lib ? I know it's in /usr/lib but i can't figure out how to tell php that. am i out of luck cause its rpm? I've never had to reconfig something rpm based so i don't know what im doin. is there a way to tell it where to look via php.ini maybe?

After alot of digging around in various forums and countless websites, I've come to discover that if anyone else has a similar problem to mine there is hope. So quick recap on the situation first:

I have php installed via rpm.

I have the gd libs also installed via rpm.

gd isn't working.

 

solution:

rpm -qa php-gd

if that produces nothing then

apt-get php-gd

 

I wish they were all that simple. The research and actually finding out that a php-gd rpm

even exists, was the hardest part. Hope this helps someone else out.