LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   getting gd support for php (https://www.linuxquestions.org/questions/slackware-14/getting-gd-support-for-php-336360/)

pranith 06-23-2005 06:02 AM

getting gd support for php
 
hi,
I installed both php and gd but i dont get the support of gd to php
Could u plz tell me how to get the support
Actually there r some instuctions where u can build both php and gd then add support using ./configure --bla bla
but I want it from the packages itself
I mean i installed both .tgzs. what shud i do to gt the support
for information I installed first php the gd
thanks in anticipation
bye
pranith

keefaz 06-23-2005 06:31 AM

php slackware package has gd enabled,
why don't you just install the package ?

Also to try it :
image.php
PHP Code:

<?php
$im 
= @imagecreate(100,100)
   or die(
'Cannot Initialize new GD image stream');
$background_color imagecolorallocate($im2389999);

$white imagecolorallocate($im255255255);
imagestring($im2515'GD enabled',$white);
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>


pranith 06-23-2005 08:45 AM

hi,
I am using slackware 10.0
I installed php from http://linuxpackages.net
and when i run the script u have given it shows the following error
:::::::::
The image “http://localhost/php/line1.php” cannot be displayed, because it contains errors.
so wat do u think i shud do
bye
pranith

killerbob 06-23-2005 09:04 AM

Most likely you're not sending the right content-type header. Could you post the script in question so somebody can check it out? Or try it on a known-working server.

FWIW, a good 25% of the content on my webpage is dynamically generated graphical content by PHP. I compiled my own PHP, but I used the pre-compiled GD library for it. I'm using GD extensively, most obviously in the gallery which generates thumbnails on the fly and is able to resize pictures dynamically from the original source.

keefaz 06-23-2005 09:15 AM

Also to debug the script try to comment this line :
header('Content-type: image/png');

So any error message will be displayed or
use command : tail /var/log/apache/error_log

patrickdepingui 06-23-2005 10:55 AM

The first line of your file should be the <?php line.
Do not put any whitespace before it...

I tried the same, and I had an empty line before the supplied code. This makes php think it has to output html code... I got exactly the same error as you did. After removing the empty line it works.

pranith 06-23-2005 12:05 PM

thanks all of u
I put the space :(
Now i removed it.Its working


All times are GMT -5. The time now is 10:56 PM.