Click to See Complete Forum and Search --> : how setup GD'function of php4(at window200)


Anon
08-05-2000, 12:58 AM
i have the lastest php_gd.dll of php4,but when i have modified php.ini and copied php_gd.dll to winnt\system32\,i found php4 isn't work.why ?and how i should do???

Anon
08-05-2000, 03:24 AM
i have installed gd lib on win98,you can try on win 2000.
first you have to download all the dlls from
swwwing.com /php4 then replace them with in your php4 foler. use phpts.exe instead of php.exe.
place mvsr.dll and php4ts.dll
in wint/system
and then try it.
if you still gets problem then ask me

Anon
08-05-2000, 03:26 AM
i have installed gd lib on win98,you can try on win 2000.
first you have to download all the dlls from
swwwing.com /php4 then replace them with in your php4 foler. use phpts.exe instead of php.exe.
place mvsr.dll and php4ts.dll
in wint/system
and then try it.
if you still gets problem then ask me

Anon
08-05-2000, 03:26 AM
i have installed gd lib on win98,you can try on win 2000.
first you have to download all the dlls from
swwwing.com /php4 then replace them with in your php4 folder. use phpts.exe instead of php.exe.
place mvsr.dll and php4ts.dll
in wint/system
and then try it.
if you still gets problem then ask me

Anon
08-05-2000, 05:38 AM
hello rohit,
i'm not able to find gd dll's for windows, and the url that u specified does not exist.
can u please elaborate a little more about the website or do u know any mirror site,where i can find these dll's.

Anon
08-05-2000, 07:24 AM
check this
http://download.swwwing.com/php4/

Anon
08-07-2000, 05:13 AM
i download that gd dll's from
swwwing.com /php4 and do all the things as u said.the phpinfo shows gd's work.

but the gd works only the first time i run png script . after that ,it allways try to download the png_file from the target script.
what's wrong?
what should i do?

Anon
08-07-2000, 06:43 AM
I've done everything but it's not working at all.
Apache 1.3.11, php4 on W98
Could you mail me exactly what I have to do?

Thank you very much

Anon
08-07-2000, 09:09 AM
I have already posted all the steps to install gd lib on win98(Apache as server).
explain me how you proceed step by step.
rohit

Anon
08-07-2000, 09:11 AM
I have already posted all the steps to install gd lib on win98(Apache as server).
explain me how you proceed step by step.
rohit

Anon
08-07-2000, 09:27 AM
Hi

I downloaded all files from http://download.swwwing.com/php4/modules/
and instaled to my php4 directory. Then I also downloaded phpts.exe and php4ts.dll from http://download.swwwing.com/php4/core/.
Next step was that I moved msvcrt.dll and php4ts to c:\windows\system directory.
Also I made changes to httpd.conf file
Action application/x-httpd-php "/php/phpts.exe". I'm trying to run litle php script
<?

header("Content-type: image/gif");
$string = implode($argv, " ");
$im = ImageCreateFromGif("headera.gif");
$orange = ImageColorAllocate($im, 220, 210, 60);
$px = (imagesx($im) -7.5*strlen($string))/2;
ImageString($im, 3, $px, 9, $string, $orange);
ImageGif($im);
ImageDestroy($im);

?>
but I get error message something like this
<b>Warning</b>: ImageCreateFromGif: No GIF support in this PHP build in <b>c:\web\test\gdtest.php</b> on line <b>5</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>c:\web\test\gdtest.php</b> on line <b>6</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>c:\web\test\gdtest.php</b> on line <b>7</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>c:\web\test\gdtest.php</b> on line <b>8</b><br>
<br>
<b>Warning</b>: ImageGif: No GIF support in this PHP build in <b>c:\web\test\gdtest.php</b> on line <b>9</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>c:\web\test\gdtest.php</b> on line <b>10</b><br>

Can you help me ?

Thank You

Anon
08-08-2000, 02:46 AM
we are using 1.8+ gd lib which does not
support gif images
so use jpg.
try it
<?

header("Content-type: image/jpeg");
$string = implode($argv, " ");
$im = ImageCreateFromJpeg("headera.jpg");
$orange = ImageColorAllocate($im, 220, 210, 60);
$px = (imagesx($im) -7.5*strlen($string))/2;
ImageString($im, 3, $px, 9, $string, $orange);
ImageJpeg($im);
ImageDestroy($im);

?>
best of luck

Anon
08-08-2000, 03:04 AM
Thank You !!!!

Now it's working !!!!

Do you know where gd lib will support gif images ? I'm asking because 90% of images I'm using are in gif format.

Thanks again !!!!

DAN

Anon
08-08-2000, 03:17 AM
i don't tried for that but u can download
1.6 gd lib from bourtel.com and then compile it.

Anon
08-08-2000, 03:31 AM
can u give me url to that 1.6 version?
bourtel.com is not working
Dan

Anon
08-08-2000, 03:39 AM
One more question.

I need to rotate text 90 deg to left.
I tried to use script I desribed before.
I passed text as a argument. With your help it's done. Problem is rotation !!
Any ideas? I will appreciate it.

Dan

Anon
08-08-2000, 04:02 AM
http://www.boutell.com/gd/

Anon
08-09-2000, 03:49 AM
Hi,

GD lib is seems to work just fine for JPEG images, but not for PNG. When I try to load an PNG image, I always get the CGI program Error message that is error in phpts.exe.

Here is the demo code:

<?php

LoadJpeg( "sample.jpg" );
//LoadJpeg( "sample.png" );

function LoadPNG ( $imgname ) {
$im = @ImageCreateFromPNG ($imgname); // Attempt to open
if (!$im) { // See if it failed
$im = ImageCreate (150, 30); // Create a blank image
$bgc = ImageColorAllocate ($im, 255, 255, 255);
$tc = ImageColorAllocate ($im, 0, 0, 0);
ImageFilledRectangle ($im, 0, 0, 150, 30, $bgc);
// Output an errmsg
ImageString ($im, 1, 5, 5, "Error loading $imgname", $tc);
}
ImagePNG( $im );
}

function LoadJpeg ( $imgname ) {
$im = @ImageCreateFromJpeg ($imgname); // Attempt to open
if (!$im) { // See if it failed
$im = ImageCreate (150, 30); // Create a blank image
$bgc = ImageColorAllocate ($im, 255, 255, 255);
$tc = ImageColorAllocate ($im, 0, 0, 0);
ImageFilledRectangle ($im, 0, 0, 150, 30, $bgc);
// Output an errmsg
ImageString ($im, 1, 5, 5, "Error loading $imgname", $tc);
}
ImageJpeg( $im );
}

?>

Anon
08-09-2000, 03:53 AM
Uff,

I made a mistake in code above. The php code should be:

<?php

//LoadJpeg( "sample.jpg" );
LoadPng( "sample.png" );

function LoadPNG ( $imgname ) {
$im = @ImageCreateFromPNG ($imgname); // Attempt to open
if (!$im) { // See if it failed
$im = ImageCreate (150, 30); // Create a blank image
$bgc = ImageColorAllocate ($im, 255, 255, 255);
$tc = ImageColorAllocate ($im, 0, 0, 0);
ImageFilledRectangle ($im, 0, 0, 150, 30, $bgc);
// Output an errmsg
ImageString ($im, 1, 5, 5, "Error loading $imgname", $tc);
}
ImagePNG( $im );
}

function LoadJpeg ( $imgname ) {
$im = @ImageCreateFromJpeg ($imgname); // Attempt to open
if (!$im) { // See if it failed
$im = ImageCreate (150, 30); // Create a blank image
$bgc = ImageColorAllocate ($im, 255, 255, 255);
$tc = ImageColorAllocate ($im, 0, 0, 0);
ImageFilledRectangle ($im, 0, 0, 150, 30, $bgc);
// Output an errmsg
ImageString ($im, 1, 5, 5, "Error loading $imgname", $tc);
}
ImageJpeg( $im );
}

?>

I'm always getting a CGI application error message!

Simon

Anon
11-03-2000, 06:43 AM
??? Where else can I get
phpts.exe
'cause
http://download.swwwing.com/php4/
don't work.
Dirk

Anon
11-03-2000, 07:16 AM
now u need not do this,
php installer is available on http://php.weblogs.com.

rohit