Jump to content

PHP php_gd.dll error.


keysorsoze

Recommended Posts

Hi! I am having the following issue with php. I can't seem to get a page with thumbnails embedded page to display properly and it appears that php_gd.dll is missing? I have no idea and am stumped. Here is an example of what I obtain when I go to the site.

 

https://site.com/pixdownload.php

 

‰PNG IHDRÈòjà‰PLTE ëë3'‡5z—IDAT(‘c`~ÀL2¶ ù@‚ .Ñ9Æ „Ødža‘Ñm?~ñã3›: æcÒe³39ÅŒÛÒ$äÛÒ¤gœC’9“&Á¸í0Ð43iÞ6$™óoÒ0ÎÃ&s#ýcV™7ÌŒ}i’ lÉÖ<{ìÍΧ?üÀØfÃtÛÁÛ<·´à öBíì,£ ±iÚIEND®B`‚

 

I have installed gd-php, gd, but cannot render the pictures. Which are thumbnails. I also the access error in apache's log. I am running php 4.3.9. I also grepped for gd in php -m to find if gd is installed and it is.

 

Here are the error messages in the error_log.

 

PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/php_gd.so' - /usr/lib/php4/php_gd.so: cannot open shared object file: No such file or directory in Unknown on line 0

[Thu Feb 08 15:15:43 2007] [notice] Apache/2.0.52 (Red Hat) configured -- resuming normal operations

[client 192.168.39.152] PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/pixdownload.php:6) in /var/www/html/pixdownload.php on line 8

[client 192.168.39.152] PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/pixdownload.php:6) in /var/www/html/pixdownload.php on line 8

[client 192.168.39.152] PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/pixdownload.php:6) in /var/www/html/pixdownload.php on line 8

[client 192.168.39.152] PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/pixdownload.php:6) in /var/www/html/pixdownload.php on line 8

 

Can someone with PHP experience chime in on what I am missing? I have tried the editing the php.ini and adding the extension=php_gd.so with no luck.

 

 

 

I also have the code of the php file that I am trying to upload.

 

 

 

 

 

<html>

<head>

<title>Image Download</title>

</head>

 

<body><?

 

header ("Content-type: image/png");

$im = @ImageCreateFromPNG ("php.png");

if(!$im) {

$img_handle = ImageCreate (200, 20) or die ("Cannot Create image");

$back_color = ImageColorAllocate ($img_handle, 0, 10, 10);

$txt_color = ImageColorAllocate ($img_handle, 235, 235, 51);

ImageString ($img_handle, 10, 25, 5, "Image Not Found", $txt_color);

ImagePng ($img_handle); }

Else {

echo "Image is Found"; }

/*

//connect to DB

$link = mysql_connect('Localhost','fatima','1T2y3i') or die ('Cannot connect to Database: '. mysql_error());

//select DB

$db=mysql_select_db(photoGallery) or die('Cannot select PhotoGallery database: ' .mysql_error());

 

$query = "SELECT FileName, Type, Size, Content " ."FROM Avionics WHERE AID = 1";

 

$result = mysql_query($query) or die('Error, query failed:'.mysqyl_error());

list($name, $type, $size, $content) = mysql_fetch_array($result);

 

 

header("Content-type: image/jpg");

 

//original size of the image

$im = imagecreatefromstring($content);

 

if(!empty($im)){

$width=imagesx($im);

$height=imagesy($im);

 

//Thumbnail width set to 100 pixel

$imgw=100;

 

//calculate thumbnail-height from given width to maintain aspect ration

$imgh = ($height/$width) * $imgw;

 

//create new image using thumbnail-size

$thumb = imagecreate($imgw,$imgh);

 

//cope original image to thumbnail

imagecopyresized($thumb,$im,0,0,0,0,$imgw,$imgh,imagesx($im),imagesy($im));

 

//show thumbnail on screen

$out=imagejpeg($thumb);

print($out);

 

//clear memory

imagedestroy($im);

imagedestroy($thumb);

}else{

die("Sorry. The image cannot be read");

}*/

?>

</body>

</html>

Link to comment
Share on other sites

Thanks for the reply, I did not code this I am actually a Systems Administrator who has been troubleshooting this issue all day.  There was a blame on the server stating that GD is not installed and what not but it seems like the code is screwy.

 

Thanks for the help I'll let the developer know.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.