Click to See Complete Forum and Search --> : PHP GD installation verfication


gspai
07-11-2006, 04:03 PM
I have recently installed PHP-4.3.9 and PHP-GD-2.0.28 on RHEL4 . It also has apache, msql.

I needed to verify the install and created a php test script.

The output is as per the attachment and partially shown as below. Could anyone please tell me if the installation is OK . Also want to know how to check the gd installation. I have used rpms. Appreciate your response


---------------------------------------------------------------------------------------------- :confused:
PHP Version 4.3.9

System Linux rictor.ristechinc.net 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:54:53 EST 2006 i686
Build Date Nov 4 2005 11:51:10
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-apxs2=/usr/sbin/apxs'
Server API Apache 2.0 Handler
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc/php.ini
Scan this dir for additional .ini files /etc/php.d
additional .ini files parsed /etc/php.d/mysql.ini
PHP API 20020918
PHP Extension 20020429
Zend Extension 20021010
Debug Build no
Thread Safety disabled
Registered PHP Streams php, http, ftp, https, ftps, compress.bzip2, compress.zlib

This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies


--------------------------------------------------------------------------------

Houdini
07-11-2006, 04:21 PM
Just run phpinfo()
<?php
phpinfo();
?>It should show up in the table of all the stuff in your PHP install under GD

gspai
07-11-2006, 04:39 PM
houdini,

I used the same scipt. I portion of the output is shown below :i.e Configure Command part of the output page . Is the output as below normal and do I need to do ?

Please let me know.Thanks for your response.





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-apxs2=/usr/sbin/apxs'

gspai
07-11-2006, 04:43 PM
Also I didn't find the GD section.

I have attached the output page. Could please take a look at it ?


Thanks

bradgrafelman
07-11-2006, 04:54 PM
Did you manually install the GD library on this Unix machine? If so, you'll need to change "--with-gd=shared" to "--with-gd=/path/to/gd". If not, you'll need to dowload (link (http://www.boutell.com/gd/)) and install it.

EDIT: Since PHP 4.3.0, GD should be bundled with PHP. If this is the case, you simply need to use "--with-gd" with no path specified.

Houdini
07-11-2006, 05:01 PM
To enable GD-support configure PHP --with-gd[=DIR], where DIR is the GD base install directory. To use the recommended bundled version of the GD library (which was first bundled in PHP 4.3.0), use the configure option --with-gd. GD library requires libpng and libjpeg to compile.That is right from the manual. I use A windows so can't help you much here.

gspai
07-11-2006, 05:06 PM
bradgralman.

do I need to reinstall PHP and install with --gd option ?. I installed using RPM. OR is it a post installation procdure. Since I am a new bee I am unable to understand it clearly.

Thanks

bradgrafelman
07-11-2006, 05:18 PM
Not sure about using RPM. It wouldn't be a post-installation procedure as this is talking about configuring PHP as it is being compiled.

gspai
07-11-2006, 06:08 PM
bradgrafelman,

I did a php -gd

and I get the following msg :

PHP Warning: Unknown(): Unable to load dynamic libray '/usr/lib/php4/gd.so' - /usr/lib/php4/gd.so:undefined symbol: ap_php_snprintf is unknown on line 0. NO value specified for variable 'd'

Any ideas ?

bradgrafelman
07-11-2006, 06:10 PM
I haven't a clue. Perhaps the gd version is too old to support the PHP version? Not sure, I'm just guessing blindly here - never actually compiled/installed PHP on a 'nix machine.

tsinka
07-11-2006, 06:33 PM
Hi,

that "undefined symbol" error message means that the gd extension module isn't compatible with the installed apache version.

The phpinfo output show that apache 2.0.52 is installed. In your first post you wrote that you installed PHP-GD-2.0.28. Seems like this one has been compiled for apache 2.0.28. I think that apache 2.0.52 doesn't export the symbol ap_php_snprintf.

Either find a php-gd package that matches the apache version or try to compile the gd extension yourself. You can do that without recompiling php completely.

But you may need to install the php-devel package (if available, I don't know RedHat that good).

Check if the executables php-config and phpize exist on your system. Then download the php source package from the php website (there's a link to the old php versions on the left side of the download page).

Execute the comands

/path/to/phpize --version (and check that the output matches the one on the phpinfo page)

/path/to/php-config --version (and check that the version matches the php version on the phpinfo page)

Extract the PHP tarball and change to the directory <phpsource>/ext/gd

Then execute the command phpize which will create the configure script an some other files.

Next execute the following command:

./configure --with-gd=shared --with-php-config=/path/to/php-config --with-zlib-dir=/usr --with-freetype-dir=/usr

Depending on your system setup (and the features you want to enable) you may need additional switches:

--with-jpeg-dir=/usr
--with-png-dir=/usr

You may need to tweak the directories a little bit and/or install the zlib,freetype, jpeg.... devel packages.

After that execute make.

After successfull compilation there should be a directory named modules with a .so file. Copy that .so file into the directory with the other extension files and add the line

extension=gd.so

to php.ini. Then restart apache. This procedure worked without any problems on my test system (SuSE linux) but you need to have gcc and some other tools on your server in order to compile the extension yourself.

The easiest way is to find a gd extension package that matches the php and apache versions.

Thomas

cgraz
07-11-2006, 06:55 PM
moved to install.

gspai
07-11-2006, 09:15 PM
tsinka,

I downloaded the correct cersion of php-gd and installed it. I used a rpm . When check with the phpinfo script the section gd does not appear.

What I need to do to make it work. Do I need to uninstall the rpm version of PHP and php-gd and redo by downloading the tar.gz version from the php.net ?


Please let me know . Thanks for your response

tsinka
07-12-2006, 03:58 AM
Did you add the line extension=gd.so to php.ini and restart apache ?

Thomas