Operating System - HP-UX
1753414 Members
7008 Online
108793 Solutions
New Discussion юеВ

Re: Apache, PHP and Images

 
SOLVED
Go to solution
MR VILLOT   MR MONTAGNE
Frequent Advisor

Re: Apache, PHP and Images

I upgraded my webserver and configured configuration files.

Now when i try to check my library with gd scripts on my host with mozilla, I get :

The image "http://machine/info/testgd.php" cannot displayed, because it contains erros.

error_log in apache gives :
[Thu May 12 15:54:20 2005] [error] an unknown filter was not added: PHP

Alex Lavrov.
Honored Contributor

Re: Apache, PHP and Images

If you execute it on it's own, not in tag:

http://machine/info/testgd.php

What are the PHP errors that you get?
I don't give a damn for a man that can only spell a word one way. (M. Twain)
MR VILLOT   MR MONTAGNE
Frequent Advisor

Re: Apache, PHP and Images

/opt/hpws/apache/htdocs/info#more imagepng.php
$image=imagecreate(100,100);
$bleu=imagecolorallocate($image,0,0,255);
imagefill($image,0,0,$bleu);
header('Content-type: image/png');
imagepng($image);
?>

url : http://machine/info/imagejpeg.php = OK
but http://machine/info/imagepng.php = same erros as before in my browser and in error _log.

with this script :
$im = imagecreatetruecolor (300, 200);
$black = imagecolorallocate ($im, 0, 0, 0);
$white = imagecolorallocate ($im, 255, 255, 255);

imagefilledrectangle($im,0,0,399,99,$white);
imagerectangle($im,20,20,250,190,$black);

header ("Content-type: image/png");
imagepng ($im);
?>
--> same thing
MR VILLOT   MR MONTAGNE
Frequent Advisor

Re: Apache, PHP and Images


New info :
I have this message in error_log file :
libpng warning: Application was compiled with png.h from libpng-1.0.11
libpng warning: Application is running with png.c from libpng-1.2.8

I have installed patch PHSS_30970 : ld(1) and linker tools cumulative patch on my host.

Alex Lavrov.
Honored Contributor

Re: Apache, PHP and Images

I don't think this patch gonna help, because you are not compiling and linking programs, you're installing precompiled binaries.

According to the message, you have a mistmatch in binaries. Did you install all the newest libraries? gd, libpng?
Never seen this message before.



I don't give a damn for a man that can only spell a word one way. (M. Twain)
Ermin Borovac
Honored Contributor
Solution

Re: Apache, PHP and Images

Ok, you're almost there :-)

/opt/hpws/apache/hpws_docs/php.admin.guide lists libpng 1.0.11 as a dependency for gd.sl.

You need to get source for libpng 1.0.x and compile it (unless you can find already built depot).

I think libpng-1.0.18 will do fine.

http://prdownloads.sourceforge.net/libpng/libpng-1.0.18.tar.gz?download

After untar'ing the file you will find a makefile for hp-ux in scripts directory. Use makefile.hpgcc for gcc, or makefile.hpux for cc.

$ cp scripts/makefile.hpgcc makefile
$ make
# make install
MR VILLOT   MR MONTAGNE
Frequent Advisor

Re: Apache, PHP and Images

Thanks to you for your help.

It works fine !

Final Configuration :
hpuxwsApache A.2.0.53.00 HP-UX Apache-based Web Server
Apache/2.0.53 HP-UX_Apache-based_Web_Server (Unix) DAV/2 PHP/4.3.8
GD Version bundled (2.0.23 compatible)
libpng 1.0.18.
MR VILLOT   MR MONTAGNE
Frequent Advisor

Re: Apache, PHP and Images

Thread closed