Current location: Hot Scripts Forums » Programming Languages » PHP » problem with imagecreate


problem with imagecreate

Reply
  #1 (permalink)  
Old 01-04-05, 01:10 AM
endrigecko endrigecko is offline
New Member
 
Join Date: Jan 2005
Location: bandung, indonesia
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
problem with imagecreate

hi, i'm a newbie here..i just installed PHP 4.3.10 in my computer...i want to use imagecreate() function and i have a slight problem with it...everytime i try to run this script (which is the example from php.net):

<?
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);
?>

the browser said "The Image "http://localhost/belajar/imagetest.php" cannot be displayed, because it contains errors"
I hope somebody can help me with this...thx
Reply With Quote
  #2 (permalink)  
Old 01-04-05, 02:33 AM
Sabu Sabu is offline
Junior Code Guru
 
Join Date: Sep 2004
Posts: 458
Thanks: 0
Thanked 0 Times in 0 Posts
You should comment out the header and the imagepng line to see if it's outputting any errors.
Reply With Quote
  #3 (permalink)  
Old 01-04-05, 02:59 AM
thanh_bkhn thanh_bkhn is offline
Newbie Coder
 
Join Date: Sep 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Be sure the gd2 extensions is installed first.

in the php.ini file, put the following line:
extension=php_gd2.dll
Reply With Quote
  #4 (permalink)  
Old 01-04-05, 04:45 AM
endrigecko endrigecko is offline
New Member
 
Join Date: Jan 2005
Location: bandung, indonesia
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
i just put the line extension=php_gd2.dll in the php.ini file nad new problem occur..it seems a window pops tells a warning:

Unknown(): gd: Unable to initializa module
Module compiled with module API=20010901, debug=0, thread safety=1
PHP compiled with module API=20020429, debug=0, thread-safety=1
These options need to match

i'm using a php triad 2.2.1 and i just upgrade the PHP in the directory from version 4.1.1 to 4.3.1 is that could be the problem? thanks for the reply..
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie found a solution to a date problem. mickey_kamer Perl 4 05-09-07 05:54 AM
Count problem kasic ASP.NET 1 10-20-04 12:23 AM
Asp and Microsoft Access 2002 problem gop373 ASP 2 10-06-04 09:13 AM
regexp problem <?Wille?> PHP 9 09-23-04 05:02 AM
an unusual problem.... fabulosas10 PHP 0 07-16-04 02:03 AM


All times are GMT -5. The time now is 05:24 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.