alin19 Posted January 22, 2008 Share Posted January 22, 2008 can i create an image(or a grafic) with only php? i'm reading in my book that i need pearl; <?php $width = 34*M_PI; $height = 110; $img = imagecreate($width,$height); $background = imagecolorallocate($img,200 ,200 ,200); $black = imagecolorallocate($img, 0 , 0, 0); $interval = 2*M_PI; for ($i=0; $i <$interval; $i+=0.01) { $m = 5 + (( $width/(2*M_PI)-2))*$i; $n= 5 + ($height/2-5)*(1-sin($i)); imagesetpixel ($img, $m, $n, $black); } header("Content-type: image/png"); imagepng($img); imagedestroy($img); ?> i get this error: Fatal error: Call to undefined function: imagecreate() in c:\program files\easyphp1-8\www\tabel.php on line 4 Link to comment https://forums.phpfreaks.com/topic/87180-solved-generating-grafic/ Share on other sites More sharing options...
Barand Posted January 22, 2008 Share Posted January 22, 2008 That code generates a sine wave OK. You need to to edit your php.ini file and remove the ";" from the beginning of the line ;extension=php_gd2.dll and make sure that dll is your folder with the other extensions. Link to comment https://forums.phpfreaks.com/topic/87180-solved-generating-grafic/#findComment-445909 Share on other sites More sharing options...
alin19 Posted January 22, 2008 Author Share Posted January 22, 2008 i have done that and still geting an error; Link to comment https://forums.phpfreaks.com/topic/87180-solved-generating-grafic/#findComment-445939 Share on other sites More sharing options...
alin19 Posted January 22, 2008 Author Share Posted January 22, 2008 can't you help me? Link to comment https://forums.phpfreaks.com/topic/87180-solved-generating-grafic/#findComment-446174 Share on other sites More sharing options...
resago Posted January 22, 2008 Share Posted January 22, 2008 did you restart the web server? Link to comment https://forums.phpfreaks.com/topic/87180-solved-generating-grafic/#findComment-446180 Share on other sites More sharing options...
alin19 Posted January 22, 2008 Author Share Posted January 22, 2008 yes; it is easyphp 1.8 that i'm using, and i have another php intalled on the computer, that i use for comand line can there be a conflict? Link to comment https://forums.phpfreaks.com/topic/87180-solved-generating-grafic/#findComment-446210 Share on other sites More sharing options...
alin19 Posted January 22, 2008 Author Share Posted January 22, 2008 solve it boys; 10x; my mistake; there are more than one php.ini: C:\Program Files\EasyPHP1-8\apache\ C:\Program Files\EasyPHP1-8\php\ i only modify this one C:\Program Files\EasyPHP1-8\conf_files\ Link to comment https://forums.phpfreaks.com/topic/87180-solved-generating-grafic/#findComment-446227 Share on other sites More sharing options...
Barand Posted January 22, 2008 Share Posted January 22, 2008 phpinfo() will tell you which one it is using. Link to comment https://forums.phpfreaks.com/topic/87180-solved-generating-grafic/#findComment-446337 Share on other sites More sharing options...
alin19 Posted January 22, 2008 Author Share Posted January 22, 2008 10x; i'm just learning php from books, Link to comment https://forums.phpfreaks.com/topic/87180-solved-generating-grafic/#findComment-446340 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.