Hello everybody,

I´ve been trying all morning to get the GD library to work but in vain 🙁
I´m using php 4 which is supposed to have the gd2 library included, I uncommented the extension=php_gd2.dll reference in php.ini

I create index.php file with the following code:

<html>
<head>
</head>
<body>
<img src="grid.php" border=1>
</body>
</html>

grid.php looks like this: (taken from he php.net site)

<?php
header("Content-type: image/png");
$im = @imagecreate(100, 50)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);
?>

When I run index.php on my server I only get a box with the red cross in it, as if the server doesnt´find the image.

I have failed to find any checklist online that can gudie me through this, do you guys see if I´m doing anything wrong ? 🙂

    One suggestion I'd have is that you move the header line down a bit:

    <?php
    $im = @imagecreate(100, 50)
    or die("Cannot Initialize new GD image stream");
    $background_color = imagecolorallocate($im, 255, 255, 255);
    $text_color = imagecolorallocate($im, 233, 14, 91);
    imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
    header("Content-type: image/png");
    imagepng($im);
    imagedestroy($im);
    ?>
    

    So that you only send the image/png header if there really is an image to send. That way the browser won't try and interpret the string "Cannot Initialize new GD image stream" as PNG data.

    And I'd take the error-message-suppressing '@' off until you're sure it's working.

      Definitely go with Weedpacket's suggestion; we WANT the script to have as much chance of erroring out at this point so we can see what's going on, so the error surpressor should be used only when in a production environment and you'd rather make it look nice and neat.

      Another suggestion would be to look for EMPTY LINES or SPACES before or after the <?PHP ?> tags in grid.php, as these will output the headers before your script has a chance to do so. I find this is a common error when people are trying to use headers/GD.

        I´ve changed grid.php into this now:

        <?php
        $im = @imagecreate(100, 50);
        $background_color = imagecolorallocate($im, 255, 255, 255);
        $text_color = imagecolorallocate($im, 233, 14, 91);
        imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
        header("Content-type: image/png");
        imagepng($im);
        imagedestroy($im);
        ?>

        There are no spaces ot empty lines between <?php and ?> and I´ve taken the "or die" command away. Still I only receive a red cross. Is it correctly assumed that the only thing I should need to do is to uncommend the dll reference in php.ini in order to activate the gd library? and yes, I have restarted the Apache server.

          I think the library works in a way. I got this code from php.net

          <?php

          function miniature($pict, $dest_pict){

          $handle = @imagecreatefromjpeg($pict);

          $x=imagesx($handle);
          $y=imagesy($handle);

             if($x > $y){                                
                     $max = $x;                          
                     $min = $y;                          
             }                                          
             if($x <= $y){                                
                     $max = $y;                          
                     $min = $x;                          
             }                                        

          //$size_in_pixel : Size max of the label in pixel. The size of the picture being
          //proportional to the original, this value define maximum size
          //of largest side with dimensions of the picture. Sorry for my english !

          //Here $size_in_pixel = 100 for a thumbnail.
          $size_in_pixel = '100';

             $rate = $max/$size_in_pixel;
             $final_x = $x/$rate;
             $final_y = $y/$rate;
          
             if($final_x > $x) {
                     $final_x = $x;
                     $final_y = $y;
             }
          
             $final_x = ceil($final_x);
             $final_y = ceil($final_y);
          
             $black_picture = imageCreatetruecolor($final_x,$final_y);
             imagefill($black_picture,0,0,imagecolorallocate($black_picture, 255, 255, 255));
             imagecopyresampled($black_picture, $handle, 0, 0, 0, 0,$final_x, $final_y, $x, $y);
          
             if(!@imagejpeg($black_picture,$dest_pict.'/mini_'.$pict, $size_in_pixel))
             imagestring($black_picture, 1, $final_x-4, $final_y-8, ".", imagecolorallocate($black_picture,0,0,0));
          
             //The number is the quality of the result picture
             imagejpeg($black_picture,'', '100');
          /*   imagedestroy($handle);
             imagedestroy($black_picture);*/

          }

          $pict = "c:\webroot\vartala.jpg";
          $dest_pict = "c:\";
          miniature($pict, $dest_pict);

          ?>

          $x and $y contain the right information, so GD works in a way, but when I try imagejpeg(....) I get a bunch of characters on tghe sceen and the ciomputer starts beeping constantly.... resulting in a system restart. I´m completely baffled about his 🙁

            Do a phpinfo() and tell us what it says about the GD library.

            Also, can we have a link to this page?

            Lastly, why did you get rid of the 'or die' code? That was what we were going for, so that we could see if there were errors...

              I didn't mean for you to take of the die() statement, I meant for you to take off the '@' that was blocking any error message that might have been generated by imagecreate().

              In fact, while I think about it, just for the sake of argument, comment out the header() line completely. If you get as far as seeing a load of gibberish that starts with &#137;PNG&#13;&#10;&#26;, then we'll know we're on the right track.

                Here is the phpinfo(). Can´t seem to find gd mntioned there even though I´ve uncommented the reference in php.ini 🙁
                I put it in 2 posts because the message is too long.....

                PHP Version 4.3.4

                System Windows NT V-RB2436 5.1 build 2600

                Build Date Nov 2 2003 23:43:42

                Server API Apache

                Virtual Directory Support enabled

                Configuration File (php.ini) Path C:\WINDOWS\php.ini

                PHP API 20020918

                PHP Extension 20020429

                Zend Extension 20021010

                Debug Build no

                Thread Safety enabled

                Registered PHP Streams php, http, ftp, compress.zlib

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


                PHP Credits


                Configuration
                PHP Core
                Directive Local Value Master Value
                allow_call_time_pass_reference Off Off
                allow_url_fopen On On
                always_populate_raw_post_data Off Off
                arg_separator.input & &
                arg_separator.output & &
                asp_tags Off Off
                auto_append_file no value no value
                auto_prepend_file no value no value
                browscap no value no value
                default_charset no value no value
                default_mimetype text/html text/html
                define_syslog_variables Off Off
                disable_classes no value no value
                disable_functions no value no value
                display_errors Off Off
                display_startup_errors Off Off
                doc_root no value no value
                docref_ext no value no value
                docref_root no value no value
                enable_dl On On
                error_append_string no value no value
                error_log no value no value
                error_prepend_string no value no value
                error_reporting 2047 2047
                expose_php On On
                extension_dir c:\php\extensions\ c:\php\extensions\
                file_uploads On On
                gpc_order GPC GPC
                highlight.bg #FFFFFF #FFFFFF
                highlight.comment #FF8000 #FF8000
                highlight.default #0000BB #0000BB
                highlight.html #000000 #000000
                highlight.keyword #007700 #007700
                highlight.string #DD0000 #DD0000
                html_errors On On
                ignore_repeated_errors Off Off
                ignore_repeated_source Off Off
                ignore_user_abort Off Off
                implicit_flush Off Off
                include_path .;c:\php4\pear .;c:\php4\pear
                log_errors On On
                log_errors_max_len 1024 1024
                magic_quotes_gpc Off Off
                magic_quotes_runtime Off Off
                magic_quotes_sybase Off Off
                max_execution_time 30 30
                max_input_time 60 60
                open_basedir no value no value
                output_buffering 4096 4096
                output_handler no value no value
                post_max_size 8M 8M
                precision 14 14
                register_argc_argv Off Off
                register_globals Off Off
                report_memleaks On On
                safe_mode Off Off
                safe_mode_exec_dir no value no value
                safe_mode_gid Off Off
                safe_mode_include_dir no value no value
                sendmail_from no value no value
                sendmail_path no value no value
                serialize_precision 100 100
                short_open_tag On On
                SMTP localhost localhost
                smtp_port 25 25
                sql.safe_mode Off Off
                track_errors Off Off
                unserialize_callback_func no value no value
                upload_max_filesize 2M 2M
                upload_tmp_dir no value no value
                user_dir no value no value
                variables_order GPCS GPCS
                xmlrpc_error_number 0 0
                xmlrpc_errors Off Off
                y2k_compliance On On

                apache
                Apache for Windows 95/NT

                Apache Version Apache/1.3.28 (Win32) PHP/4.3.4

                Apache Release 10324100

                Apache API Version 19990320

                Hostname😛ort localhost:80

                Timeouts Connection: 300 - Keep-Alive: 15

                Directive Local Value Master Value
                child_terminate 0 0
                engine 1 1
                last_modified 0 0
                xbithack 0 0

                Apache Environment
                Variable Value
                COMSPEC C:\WINDOWS\system32\cmd.exe

                DOCUMENT_ROOT xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, /

                HTTP_ACCEPT_ENCODING gzip, deflate

                HTTP_ACCEPT_LANGUAGE is

                HTTP_CONNECTION Keep-Alive

                HTTP_HOST xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FunWebProducts; SV1; .NET CLR 1.1.4322)

                PATH C:\IBM Connectors\Encina\bin;;C:\IBMCON~1\CICS\BIN;C:\PVSW\BIN;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\MSSQL7\BINN;C:\PROGRA~1\ULTRAE~1;C:\Program Files\ObjREXX;C:\SQLLIB\BIN;C:\SQLLIB\FUNCTION;C:\SQLLIB\SAMPLES\REPL;C:\SQLLIB\HELP;C:\IBM\IMNNQ;C:\IBMVAGEN\VGWGS45\;C:\IBMVAGEN\VGWGS45\VA36;C:\IBMVAGEN\VGCSO45\;C:\IBMVAGEN\VGCSO45\VA36;C:\IBMVAGEN\VGCSO45\exe;C:\Program Files\IBM\Trace Facility\;C:\Program Files\IBM\Personal Communications\;C:\Program Files\IBM\Director\bin;c:\php\bin\;c:\perl\bin\;c:\djgpp_compiler\bin\;c:\php\;c:\sun\AppServer\jdk\bin;C:\Program Files\PKWARE\pkzipc;C:\Program Files\7-Zip;C:\j2sdk1_4_2_4\jre\bin\client;c:\php5\

                REMOTE_ADDR xxxxxxxxxxxxxxxxxxxxxxx
                REMOTE_PORT xxxxxxxxxxxxxxxxxx
                SCRIPT_FILENAME xxxxxxxxxxxxxxxxxxxxxx
                SERVER_ADDR 127.0.0.1

                SERVER_ADMIN xxxxxxxxxxxxxxxxxxxxxx
                SERVER_NAME xxxxxxxxxxxxxxxxxxx
                SERVER_PORT xxxxxxxxxxxxxxxxxxx
                SERVER_SIGNATURE <ADDRESS>xxxxxxxxxxxxxxxx</ADDRESS>

                SERVER_SOFTWARE Apache/1.3.28 (Win32) PHP/4.3.4

                SystemRoot C:\WINDOWS

                WINDIR C:\WINDOWS

                GATEWAY_INTERFACE CGI/1.1

                SERVER_PROTOCOL HTTP/1.1

                REQUEST_METHOD GET

                QUERY_STRING no value

                REQUEST_URI /ee.php

                SCRIPT_NAME /ee.php

                HTTP Headers Information
                HTTP Request Headers
                HTTP Request GET /ee.php HTTP/1.1

                Accept image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, /

                Accept-Encoding gzip, deflate

                Accept-Language is

                Connection Keep-Alive

                Host localhost

                User-Agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FunWebProducts; SV1; .NET CLR 1.1.4322)

                HTTP Response Headers
                X-Powered-By PHP/4.3.4

                Keep-Alive timeout=15, max=95

                Connection Keep-Alive

                Transfer-Encoding chunked

                Content-Type text/html

                bcmath
                BCMath support enabled

                calendar
                Calendar support enabled

                com
                Directive Local Value Master Value
                com.allow_dcom Off Off
                com.autoregister_casesensitive On On
                com.autoregister_typelib Off Off
                com.autoregister_verbose Off Off
                com.typelib_file no value no value

                ctype
                ctype functions enabled

                ftp
                FTP support enabled

                mysql
                MySQL Support enabled
                Active Persistent Links 0

                Active Links 0

                Client API version 3.23.49

                Directive Local Value Master Value
                mysql.allow_persistent On On
                mysql.connect_timeout 60 60
                mysql.default_host no value no value
                mysql.default_password no value no value
                mysql.default_port no value no value
                mysql.default_socket no value no value
                mysql.default_user no value no value
                mysql.max_links Unlimited Unlimited
                mysql.max_persistent Unlimited Unlimited
                mysql.trace_mode Off Off

                odbc
                ODBC Support enabled
                Active Persistent Links 0

                Active Links 0

                ODBC library Win32

                Directive Local Value Master Value
                odbc.allow_persistent On On
                odbc.check_persistent On On
                odbc.default_db no value no value
                odbc.default_pw no value no value
                odbc.default_user no value no value
                odbc.defaultbinmode return as is return as is
                odbc.defaultlrl return up to 4096 bytes return up to 4096 bytes
                odbc.max_links Unlimited Unlimited
                odbc.max_persistent Unlimited Unlimited

                  overload
                  User-Space Object Overloading Support enabled

                  pcre
                  PCRE (Perl Compatible Regular Expressions) Support enabled

                  PCRE Library Version 4.3 21-May-2003

                  session
                  Session Support enabled

                  Registered save handlers files user

                  Directive Local Value Master Value
                  session.auto_start Off Off
                  session.bug_compat_42 Off Off
                  session.bug_compat_warn On On
                  session.cache_expire 180 180
                  session.cache_limiter nocache nocache
                  session.cookie_domain no value no value
                  session.cookie_lifetime 0 0
                  session.cookie_path / /
                  session.cookie_secure Off Off
                  session.entropy_file no value no value
                  session.entropy_length 0 0
                  session.gc_divisor 1000 1000
                  session.gc_maxlifetime 1440 1440
                  session.gc_probability 1 1
                  session.name PHPSESSID PHPSESSID
                  session.referer_check no value no value
                  session.save_handler files files
                  session.save_path c:\session\ c:\session\
                  session.serialize_handler php php
                  session.use_cookies On On
                  session.use_only_cookies Off Off
                  session.use_trans_sid Off Off

                  standard
                  Regex Library Bundled library enabled

                  Dynamic Library Support enabled

                  Internal Sendmail Support for Windows enabled

                  Directive Local Value Master Value
                  assert.active 1 1
                  assert.bail 0 0
                  assert.callback no value no value
                  assert.quiet_eval 0 0
                  assert.warning 1 1
                  auto_detect_line_endings 0 0
                  default_socket_timeout 60 60
                  safe_mode_allowed_env_vars PHP PHP
                  safe_mode_protected_env_vars LD_LIBRARY_PATH LD_LIBRARY_PATH
                  url_rewriter.tags a=href,area=href,frame=src,input=src,form=fakeentry a=href,area=href,frame=src,input=src,form=fakeentry
                  user_agent no value no value

                  tokenizer
                  Tokenizer Support enabled

                  wddx
                  WDDX Support enabled
                  WDDX Session Serializer enabled

                  xml
                  XML Support active

                  XML Namespace Support active

                  EXPAT Version 1.95.6

                  zlib
                  ZLib Support enabled

                  Compiled Version 1.1.4

                  Linked Version 1.1.4

                  Directive Local Value Master Value
                  zlib.output_compression Off Off
                  zlib.output_compression_level -1 -1
                  zlib.output_handler no value no value

                  Additional Modules
                  Module Name

                  Environment
                  Variable Value
                  ALLUSERSPROFILE C:\Documents and Settings\All Users

                  BGROOT C:\Bluegill

                  CHECKFREE q:\Checkfree\i-Series\java\

                  CLASSPATH C:\IBMCON~1\CICS\Classes\CTGCLI~1.JAR;.;C:\SQLLIB\java\db2java.zip;C:\SQLLIB\java\runtime.zip;C:\SQLLIB\java\sqlj.zip;C:\SQLLIB\bin;C:\IBMVAGEN\VGWGS45\;C:\IBMVAGEN\VGWGS45\hptGateway.jar;C:\IBMVAGEN\VGWGS45\vgjwgs.jar;C:\IBMVAGEN\VGCSO45\;C:\IBMVAGEN\VGCSO45\hpt.jar

                  CommonProgramFiles C:\Program Files\Common Files

                  COMPUTERNAME V-RB2436

                  ComSpec C:\WINDOWS\system32\cmd.exe

                  CSODIR C:\IBMVAGEN\VGCSO45\

                  DB2INSTANCE DB2

                  DB2TEMPDIR C:\SQLLIB

                  DJGPP c:\djgpp_compiler\djgpp.env

                  EZERDEVNLS e

                  EZERNLS ENU

                  EZERSQLDB SAMPLE

                  FCWCOMP VA36

                  FCWDBCS NO

                  FCWDBNAME SAMPLE

                  FCWDBVERSION 8i

                  FCWDIR C:\IBMVAGEN\VGWGS45\VA36

                  FCWDPATH C:\IBMVAGEN\VGWGS45\;C:\IBMVAGEN\VGWGS45\VA36

                  FCWMAKE C:\IBMVAGEN\VGWGS45\

                  FCWTROPT 0

                  FCWTROUT FCWTRACE.OUT

                  FP_NO_HOST_CHECK NO

                  GENERATE_INI F:\CMDS\efkgen.ini

                  ICM_FOLDER Information Catalog Manager

                  IMNINST help

                  IMNINSTSRV C:\IBM\IMNNQ

                  INCLUDE C:\IBMCON~1\CICS\Include;C:\IBM Connectors\CICS\Samples\Include;C:\SQLLIB\INCLUDE;C:\SQLLIB\LIB;C:\SQLLIB\TEMPLATES\INCLUDE;C:\IBMVAGEN\VGWGS45\INCLUDE;C:\IBMVAGEN\VGCSO45\INCLUDE

                  JAVA_HOME C:\Sun\AppServer\jdk

                  LIB C:\IBMCON~1\CICS\Lib;C:\SQLLIB\LIB;C:\IBMVAGEN\VGWGS45\LIB;C:\IBMVAGEN\VGWGS45\VA36\LIB;C:\IBMVAGEN\VGCSO45\LIB;C:\IBMVAGEN\VGCSO45\VA36\LIB;

                  MDIS_PROFILE C:\SQLLIB\METADATA\PROFILES

                  NLSPATH C:\IBM Connectors\Encina\%L\%N

                  NUMBER_OF_PROCESSORS 1

                  OS Windows_NT

                  Path C:\IBM Connectors\Encina\bin;;C:\IBMCON~1\CICS\BIN;C:\PVSW\BIN;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\MSSQL7\BINN;C:\PROGRA~1\ULTRAE~1;C:\Program Files\ObjREXX;C:\SQLLIB\BIN;C:\SQLLIB\FUNCTION;C:\SQLLIB\SAMPLES\REPL;C:\SQLLIB\HELP;C:\IBM\IMNNQ;C:\IBMVAGEN\VGWGS45\;C:\IBMVAGEN\VGWGS45\VA36;C:\IBMVAGEN\VGCSO45\;C:\IBMVAGEN\VGCSO45\VA36;C:\IBMVAGEN\VGCSO45\exe;C:\Program Files\IBM\Trace Facility\;C:\Program Files\IBM\Personal Communications\;C:\Program Files\IBM\Director\bin;c:\php\bin\;c:\perl\bin\;c:\djgpp_compiler\bin\;c:\php\;c:\sun\AppServer\jdk\bin;C:\Program Files\PKWARE\pkzipc;C:\Program Files\7-Zip;C:\j2sdk1_4_2_4\jre\bin\client;c:\php5\

                  PATHEXT .REX;.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH

                  PCOMM_Root C:\Program Files\IBM\Personal Communications\

                  PERVASIVE_PATH C:\PVSW\BIN

                  PKSFXDATA c:\Program Files\Common Files\PKWARE\Pksfxs.dat

                  PROCESSOR_ARCHITECTURE x86

                  PROCESSOR_IDENTIFIER x86 Family 15 Model 1 Stepping 2, GenuineIntel

                  PROCESSOR_LEVEL 15

                  PROCESSOR_REVISION 0102

                  ProgramFiles C:\Program Files

                  SGML_SEARCH_PATH c:\Checkfree\SmartXpress412a\dtd\sgml

                  SystemDrive C:

                  SystemRoot C:\WINDOWS

                  TEMP C:\WINDOWS\TEMP

                  TMP C:\WINDOWS\TEMP

                  USERPROFILE C:\Documents and Settings\LocalService

                  VGCSOSharingInfo DevJava;Server;CSO

                  VSL C:\PVSW\BIN

                  VWSPATH C:\SQLLIB

                  VWS_FOLDER IBM DB2

                  VWS_LOGGING C:\SQLLIB\LOGGING

                  VWS_TEMPLATES C:\SQLLIB\TEMPLATES

                  windir C:\WINDOWS

                  PHP Variables
                  Variable Value
                  SERVER["COMSPEC"] C:\WINDOWS\system32\cmd.exe
                  SERVER["DOCUMENT_ROOT"] c:/webroot
                  SERVER["HTTP_ACCEPT"] image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, /
                  SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate
                  SERVER["HTTP_ACCEPT_LANGUAGE"] is
                  SERVER["HTTP_CONNECTION"] Keep-Alive
                  SERVER["HTTP_HOST"] localhost
                  SERVER["HTTP_USER_AGENT"] Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FunWebProducts; SV1; .NET CLR 1.1.4322)
                  SERVER["PATH"] C:\IBM Connectors\Encina\bin;;C:\IBMCON~1\CICS\BIN;C:\PVSW\BIN;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\MSSQL7\BINN;C:\PROGRA~1\ULTRAE~1;C:\Program Files\ObjREXX;C:\SQLLIB\BIN;C:\SQLLIB\FUNCTION;C:\SQLLIB\SAMPLES\REPL;C:\SQLLIB\HELP;C:\IBM\IMNNQ;C:\IBMVAGEN\VGWGS45\;C:\IBMVAGEN\VGWGS45\VA36;C:\IBMVAGEN\VGCSO45\;C:\IBMVAGEN\VGCSO45\VA36;C:\IBMVAGEN\VGCSO45\exe;C:\Program Files\IBM\Trace Facility\;C:\Program Files\IBM\Personal Communications\;C:\Program Files\IBM\Director\bin;c:\php\bin\;c:\perl\bin\;c:\djgpp_compiler\bin\;c:\php\;c:\sun\AppServer\jdk\bin;C:\Program Files\PKWARE\pkzipc;C:\Program Files\7-Zip;C:\j2sdk1_4_2_4\jre\bin\client;c:\php5\
                  SERVER["REMOTE_ADDR"] xxxxxxxxxxxxxxxxxxxx
                  SERVER["REMOTE_PORT"]xxxxxxxxxxxxxxxx
                  SERVER["SCRIPT_FILENAME"] xxxxxxxxxxxxxxxxxx
                  SERVER["SERVER_ADDR"] xxxxxxxxxxxxxxxxxx
                  SERVER["SERVER_ADMIN"] xxxxxxxxxxxxxxxxxxxx
                  SERVER["SERVER_NAME"] xxxxxxxxxxxxxxxx
                  SERVER["SERVER_PORT"] xxxxxxxxxxxxxxxxxxx
                  SERVER["SERVER_SIGNATURE"] <ADDRESS></ADDRESS>

                  SERVER["SERVER_SOFTWARE"] Apache/1.3.28 (Win32) PHP/4.3.4
                  SERVER["SystemRoot"] C:\WINDOWS
                  SERVER["WINDIR"] C:\WINDOWS
                  SERVER["GATEWAY_INTERFACE"] CGI/1.1
                  SERVER["SERVER_PROTOCOL"] HTTP/1.1
                  SERVER["REQUEST_METHOD"] GET
                  SERVER["QUERY_STRING"] no value
                  SERVER["REQUEST_URI"] /ee.php
                  SERVER["SCRIPT_NAME"] /ee.php
                  SERVER["PATH_TRANSLATED"] c:/webroot/ee.php
                  SERVER["PHP_SELF"] /ee.php

                  PHP License
                  This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE

                  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

                  If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.

                    Should have been between FTP and MySQL, i.e.

                    ftp
                    FTP support enabled

                    gd
                    GD Support enabled

                    GD Version bundled (2.0.23 compatible)

                    FreeType Support enabled

                    FreeType Linkage with freetype

                    GIF Read Support enabled

                    JPG Support enabled

                    PNG Support enabled

                    WBMP Support enabled

                    XBM Support enabled

                    mysql
                    MySQL Support enabled

                    Are you sure the "c:\php\extensions\" directory exists and contains the file "php_gd2.dll" ? Double check and let us know. Also, post the line in the PHP.ini that you uncommented/enabled GD on.

                    EDIT: Also, try copying all of the .DLL files in 'c:\php\dlls\' to 'c:\windows\system32\' (replace c:\windows\ with the path you installed Windows to if that is not correct).

                      c:\php\extensiions\ does exist. Here is the output when I do a dir command:

                      Directory of c:\Php\extensions

                      17.05.2005 13:48 <DIR> .
                      17.05.2005 13:48 <DIR> ..
                      17.05.2005 13:48 0 dir.txt
                      03.11.2003 00:00 61.440 php_bz2.dll
                      03.11.2003 00:00 139.264 php_cpdf.dll
                      03.11.2003 00:00 36.864 php_crack.dll
                      03.11.2003 00:00 151.552 php_curl.dll
                      03.11.2003 00:00 24.576 php_db.dll
                      03.11.2003 00:00 385.024 php_dba.dll
                      03.11.2003 00:00 28.672 php_dbase.dll
                      03.11.2003 00:00 49.152 php_dbx.dll
                      03.11.2003 00:00 565.248 php_domxml.dll
                      03.11.2003 00:00 49.152 php_exif.dll
                      03.11.2003 00:00 36.864 php_fdf.dll
                      03.11.2003 00:00 20.480 php_filepro.dll
                      03.11.2003 00:00 778.240 php_gd2.dll
                      03.11.2003 00:00 24.576 php_gettext.dll
                      03.11.2003 00:00 106.496 php_hyperwave.dll
                      03.11.2003 00:00 20.480 php_iconv.dll
                      03.11.2003 00:16 114.688 php_ifx.dll
                      02.11.2003 16:48 106.496 php_iisfunc.dll
                      03.11.2003 00:00 593.920 php_imap.dll
                      03.11.2003 00:00 45.056 php_interbase.dll
                      03.11.2003 00:00 24.576 php_java.dll
                      03.11.2003 00:00 9.296 php_java.jar
                      03.11.2003 00:00 126.976 php_ldap.dll
                      03.11.2003 00:00 1.531.904 php_mbstring.dll
                      03.11.2003 00:00 36.864 php_mcrypt.dll
                      03.11.2003 00:00 20.480 php_mhash.dll
                      03.11.2003 00:00 24.576 php_mime_magic.dll
                      03.11.2003 00:00 188.416 php_ming.dll
                      03.11.2003 00:00 28.672 php_msql.dll
                      03.11.2003 00:00 40.960 php_mssql.dll
                      03.11.2003 00:00 65.536 php_oci8.dll
                      03.11.2003 00:00 45.056 php_openssl.dll
                      03.11.2003 00:00 32.768 php_oracle.dll
                      03.11.2003 00:00 540.672 php_pdf.dll
                      03.11.2003 00:00 106.496 php_pgsql.dll
                      02.11.2003 16:49 36.864 php_printer.dll
                      03.11.2003 00:00 53.248 php_pspell.dll
                      03.11.2003 00:00 20.480 php_shmop.dll
                      03.11.2003 00:00 241.664 php_snmp.dll
                      03.11.2003 00:00 40.960 php_sockets.dll
                      03.11.2003 00:00 40.960 php_sybase_ct.dll
                      03.11.2003 00:00 62.000 php_w32api.dll
                      03.11.2003 00:00 61.440 php_xmlrpc.dll
                      03.11.2003 00:00 32.768 php_xslt.dll
                      03.11.2003 00:00 32.768 php_yaz.dll
                      03.11.2003 00:00 40.960 php_zip.dll
                      47 File(s) 6.825.600 bytes
                      2 Dir(s) 17.523.871.744 bytes free

                      And here is the section in php.ini:

                      ;Windows Extensions
                      ;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
                      ;
                      ;extension=php_bz2.dll
                      ;extension=php_cpdf.dll
                      ;extension=php_crack.dll
                      ;extension=php_curl.dll
                      ;extension=php_db.dll
                      ;extension=php_dba.dll
                      ;extension=php_dbase.dll
                      ;extension=php_dbx.dll
                      ;extension=php_domxml.dll
                      ;extension=php_exif.dll
                      ;extension=php_fdf.dll
                      ;extension=php_filepro.dll
                      extension=php_gd2.dll
                      ;extension=php_gettext.dll
                      ;extension=php_hyperwave.dll
                      ;extension=php_iconv.dll
                      ;extension=php_ifx.dll
                      ;extension=php_iisfunc.dll
                      ;extension=php_imap.dll
                      ;extension=php_interbase.dll
                      ;extension=php_java.dll
                      ;extension=php_ldap.dll
                      extension=php_mbstring.dll
                      ;extension=php_mcrypt.dll
                      ;extension=php_mhash.dll
                      ;extension=php_mime_magic.dll
                      ;extension=php_ming.dll
                      ;extension=php_mssql.dll
                      ;extension=php_msql.dll
                      ;extension=php_oci8.dll
                      ;extension=php_openssl.dll
                      ;extension=php_oracle.dll
                      ;extension=php_pdf.dll
                      ;extension=php_pgsql.dll
                      ;extension=php_printer.dll
                      ;extension=php_shmop.dll
                      ;extension=php_snmp.dll
                      ;extension=php_sockets.dll
                      ;extension=php_sybase_ct.dll
                      ;extension=php_w32api.dll
                      ;extension=php_xmlrpc.dll
                      ;extension=php_xslt.dll
                      ;extension=php_yaz.dll
                      ;extension=php_zip.dll

                      Does the code I mentioned on the top work in your browser ? That is if you have apache installed. Does it perhaps matter which version of apache ?

                      EDIT: I also put the ddls in system32 directory and tried it again, but in vain....

                        What happens when you make a file with 'gd_info();' as the contents?

                          Contents: <?php gd_info();
                          C:\webroot>php -f 1.php

                          Contents: <?php echo gd_info();

                          C:\webroot>php -f 1.php
                          Array
                          C:\webroot>

                          According to this gd must be disabled :queasy:

                            No, [man]gd_info[/man] returns an array. And that's what it's echoing. If the function didn't exist you'd get an error message saying that the function doesn't exist (error messages are funny that way). The fact that you are getting an array says that the function is there. Now you want to see what's in the array (hint: see example 1 of the page linked to above).

                              Darn dummy me 🙂 I had tried that example before. This is when I run that example:

                              array(11) {
                              ["GD Version"]=>
                              string(27) "bundled (2.0.15 compatible)"
                              ["FreeType Support"]=>
                              bool(true)
                              ["FreeType Linkage"]=>
                              string(13) "with freetype"
                              ["T1Lib Support"]=>
                              bool(false)
                              ["GIF Read Support"]=>
                              bool(true)
                              ["GIF Create Support"]=>
                              bool(false)
                              ["JPG Support"]=>
                              bool(true)
                              ["PNG Support"]=>
                              bool(true)
                              ["WBMP Support"]=>
                              bool(true)
                              ["XBM Support"]=>
                              bool(true)
                              ["JIS-mapped Japanese Font Support"]=>
                              bool(false)
                              }

                              EDIT: Just tied the Hagan Fox script and it´s confirmed that I have version 2 installed.

                                Even i had the same problem with GD

                                Are you sure the php_gd2.dll file is in your
                                C:\WINNT\system32

                                search your system and find all php.ini files, my doubt is that you may not be modifing the active version. you can check the ini path with phpinfo();

                                you've done correct by un commenting the line in the ini file and make sure php_gd2.dll is in the extension directory

                                phpinfo() will also have a GD section once it's properly installed.

                                try to change the path of the extension library in php.ini from:
                                extension_dir = "c:\php"
                                to:
                                extension_dir = "c:\php\extensions"

                                Hope that helps

                                  Wow, I´ve never had so much trouble installing a product! I´ve copied every single dll file including php_gd2.dll into system32. In phpinfo.ini the config path was pointing towards c:\windows, so I replaced the ini file there with the one I have in c:\php
                                  I´ve double checked whether the directory extensions in php exists and whether php_gd2.dll is there.

                                  in the ini file the extension path is :
                                  extension_dir = "c:\php\extensions\"
                                  Notice the extra backslash at the end.

                                  Still the gd section won´t appear in phpinfo().

                                  Now you say it will appear in phpinfo() once it´s properly installed. I was under the impression that I don´t need to install GD, only uncomment the reference in the ini file, please correct me if I´m wrong 😕

                                    Are u working on the correct php.ini file?
                                    make sure u restart ur webserver once u have done modifications to your php.ini file.

                                      YESS!!!! finally. I did forget to restart the webserver once I replaced the ini file in c:\windows

                                      Thanks for the help!!

                                        Write a Reply...