Problem related to Gd library

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kamill
    New Member
    • Dec 2006
    • 71

    Problem related to Gd library

    I have PHP 4.1.1, and i need to use php GD library. From where i can get it. my verson will support it or not.
    Last edited by kamill; Feb 15 '07, 12:04 PM. Reason: words was missing.
  • kamill
    New Member
    • Dec 2006
    • 71

    #2
    Sorry friends my PHP verson is 4.3.11.

    Comment

    • xwero
      New Member
      • Feb 2007
      • 99

      #3
      To enable GD-support configure PHP --with-gd[=DIR] (php.net)

      if you want it on your own computer try xampp or wamp5 for easy installing everything you need.

      Comment

      • cassbiz
        New Member
        • Oct 2006
        • 202

        #4
        if you don't have the GD library you can get it from http://www.boutell.com/gd/

        Comment

        • Motoma
          Recognized Expert Specialist
          • Jan 2007
          • 3236

          #5
          How did you install PHP?

          Check phpinfo() to see if GD is already installed. It comes bundled with most installations of PHP.

          Comment

          • kamill
            New Member
            • Dec 2006
            • 71

            #6
            Dear Motoma

            i have allready checked phpinfo() to see it. GD did not install.

            Comment

            • Motoma
              Recognized Expert Specialist
              • Jan 2007
              • 3236

              #7
              Okay, what operating system are you using? How did you install PHP? From source? Binary distribution? Package Manager?

              Comment

              • jialing1000
                New Member
                • Apr 2007
                • 1

                #8
                Hi

                I'm in PHP Version 4.4.4 and the configure command contains: (checking through <?php phpinfo()?>

                '../configure' '--with-pear' '--with-mysql=/usr' '--with-zlib' '--enable-debug=no' '--enable-safe-mode=no' '--enable-discard-path=no' '--with-gd' '--with-png-dir=/usr/lib' '--enable-track-vars' '--with-db' '--with-gdbm' '--enable-force-cgi-redirect' '--with-ttf=/usr/' '--enable-ftp' '--with-mcrypt' '--enable-dbase' '--enable-memory-limit' '--enable-calendar' '--enable-wddx' '--with-jpeg-dir=/usr/src/kundenserver/jpeg-6b' '--enable-bcmath' '--enable-gd-imgstrttf' '--enable-shmop' '--enable-mhash' '--with-mhash=/usr/src/kundenserver/mhash-0.8.9/' '--with-openssl' '--enable-xslt' '--with-xslt-sablot' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--with-imap' '--with-curl' '--with-iconv=/usr/local' '--with-freetype-dir=/usr/include/freetype2' '--with-bz2' '--with-gettext' '--enable-exif' '--with-idn' '--enable-mbstring=all'

                Though I can see '--with-gd'...but when I run gd proglrm as below (and other examples from gd library site, all the results are a lot of unreadable code not drawing. I'm in 1and1 php server. How can I enable gd library? Please help. Thanks!

                <?php
                Header("Content-type: image/png");
                $height = 300;
                $width = 300;
                $im = ImageCreate($wi dth, $height);
                $bck = ImageColorAlloc ate($im, 10,110,100);
                $white = ImageColorAlloc ate($im, 255, 255, 255);
                ImageFill($im, 0, 0, $bck);
                ImageLine($im, 0, 0, $width, $height, $white);
                for($i=0;$i<=29 9;$i=$i+10) {
                ImageLine($im, 0, $i, $width, $height, $white); }
                ImagePNG($im);
                ?>

                Comment

                • Motoma
                  Recognized Expert Specialist
                  • Jan 2007
                  • 3236

                  #9
                  Move your header call down just before ImagePNG(). This will allow you to receive error messages if the GD functions fail.

                  Comment

                  Working...