[PHP] imagecreate undefined...?

2004-02-13 Thread Eric
I've got this fairly simply script:

?php
  // create a 100*30 image
  $im = imagecreate( 100, 100 );
  // white background and blue text
  $bg = imagecolorallocate($im, 255, 255, 255);
  $textcolor = imagecolorallocate($im, 0, 0, 255);
  // write the string at the top left
  imagestring($im, 5, 0, 0, Hello world!, $textcolor);
  // output the image
  header(Content-type: image/jpg);
  imagejpeg($im);
?
However, when I run it, I get an error:

Fatal error: Call to undefined function: imagecreate() in [file name] on line 3

I am running under MacOSX 10.3.2 and PHP 4.3.2.

Is there anything I should look for in the phpinfo()?
Any suggestions on how to fix the problem?
Thank you.

--
== Eric Gorr = http://www.ericgorr.net = ICQ:9293199 ===
Therefore the considerations of the intelligent always include both
benefit and harm. - Sun Tzu
== Insults, like violence, are the last refuge of the incompetent... ===
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] imagecreate undefined...?

2004-02-13 Thread Richard Davey
Hello Eric,

Friday, February 13, 2004, 4:00:02 PM, you wrote:

E Fatal error: Call to undefined function: imagecreate() in [file name] on line 3
E I am running under MacOSX 10.3.2 and PHP 4.3.2.

Sounds very much like you have PHP without the image library compiled
into it. I don't know where to obtain that lib for the Mac, sorry -
but I'm sure someone will.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]
  http://www.phpcommunity.org/wiki/296.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] imagecreate undefined...?

2004-02-13 Thread Brian V Bonini
On Fri, 2004-02-13 at 11:00, Eric wrote:
 However, when I run it, I get an error:
 
 Fatal error: Call to undefined function: imagecreate() in [file name] on line 3

Sound like your version was complied without GD support.
http://www.php.net/manual/en/ref.image.php

-- 
BrianGnuPG - KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys
  Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
GnuPG: http://gnupg.org
http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC
Linux Registered User #339825 at http://counter.li.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] imagecreate undefined...?

2004-02-13 Thread Vail, Warren
Have you tried dynamically loading the GD functions;

http://us2.php.net/manual/en/function.dl.php

if (!extension_loaded('php_gd')) {
   if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
   dl('php_gd.dll');
   } else {
   dl('gd.so');
   }
}

not sure all the names above are correct and you can eliminate a lot of
stuff for Win/Linux installations if you are not targeting both versions.

Warren Vail


-Original Message-
From: Richard Davey [mailto:[EMAIL PROTECTED]
Sent: Friday, February 13, 2004 8:07 AM
To: Eric
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] imagecreate undefined...?


Hello Eric,

Friday, February 13, 2004, 4:00:02 PM, you wrote:

E Fatal error: Call to undefined function: imagecreate() in [file name] on
line 3
E I am running under MacOSX 10.3.2 and PHP 4.3.2.

Sounds very much like you have PHP without the image library compiled
into it. I don't know where to obtain that lib for the Mac, sorry -
but I'm sure someone will.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]
  http://www.phpcommunity.org/wiki/296.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php