- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Apache, PHP and Images
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2005 10:00 PM
тАО05-05-2005 10:00 PM
I have HP-UX Apache-based Web Server and MySQL Database on HP-UX Server.
Now I would like to generate graphics with php using tools like jpgraph.
I did a simple test to generate graphics with php but I do not get anything :
Images
$image=imagecreate(100,100);
$rouge=imagecolorallocate($image,255,0,0);
imagefill($image,0,0,$rouge);
header('Content-type: image/jpeg');
imagejpeg($image);
?>
$image=imagecreate(100,100);
$bleu=imagecolorallocate($image,0,0,255);
imagefill($image,0,0,$bleu);
header('Content-type: image/png');
imagepng($image);
?>
I did also tests with jpgraph without success (blank page).I must not have good libs with PHP. I need also to configure gd librairies for jpgraph.
How can i do with this distributed version of PHP ?
Thanks
Laurent
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2005 10:08 PM
тАО05-06-2005 10:08 PM
Re: Apache, PHP and Images
Date: 10/19/04
Document description: Configuring and Testing PHP image libraries w HP Apache 2.0
Document id: MJFKBRC00015829
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2005 10:23 PM
тАО05-06-2005 10:23 PM
Re: Apache, PHP and Images
There you locate the list of extensions that you can enable and you uncomment the GD extension.
Now, when you restart apache, it will nt work, because GD requires libraries that are not installed by default on the system. A very simple way to see what are these libraries is to go to errors_log of apache (located in /opt/hpws/apache/logs) and see what library is missing. Then, you go here:
http://hpux.cs.utah.edu/
and in the search box, enter the name of the lib and install that depot (with this lib) and all it's dependencies. After a few installations it will work, I've done it several times.
It can take time, because there are many depots to install, but all of them are small, so I believe in 20-30 minutes your GD extension will work.
Regards,
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2005 10:24 PM
тАО05-06-2005 10:24 PM
Re: Apache, PHP and Images
thanx.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2005 10:32 PM
тАО05-06-2005 10:32 PM
Re: Apache, PHP and Images
You can access article as follows
http://www.itrc.hp.com -> technical knowledge base -> select 'search by doc ID' -> enter MJFKBRC00015829
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2005 10:39 PM
тАО05-06-2005 10:39 PM
Re: Apache, PHP and Images
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2005 02:46 AM
тАО05-11-2005 02:46 AM
Re: Apache, PHP and Images
Thanks for your help. It works fine with the first scripts. Now, I would like to use jpgraph with this small test :
include ("/opt/hpws/apache/htdocs/info/jpgraph-1.17/src/jpgraph.php");
include ("/opt/hpws/apache/htdocs/info/jpgraph-1.17/src/jpgraph_line.php");
$ydata = array(8,3,16,2,7,25,16);
// Creation du graphique
$graph = new Graph(300,200);
$graph->SetScale("textlin");
// CrM-iation du systM-hme de points
$lineplot=new LinePlot($ydata);
// On rajoute les points au graphique
$graph->Add($lineplot);
// Affichage
$graph->Stroke();
?>
When I browse my url I get the following message :
JpGraph Error: Can't create truecolor image. Check that you really have GD2 library installed.
My version is :
gd 2.0.33 gd
I think it could be a setting in a configuration file in jpgraph.
Laurent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2005 03:56 AM
тАО05-11-2005 03:56 AM
Re: Apache, PHP and Images
I did tests to check my GD libraries :
for GD library :
$im = @ImageCreate (150, 100)
or die ("Cannot create a new GD image.");
$background_color = ImageColorAllocate ($im, 255, 255, 255);
$text_color = ImageColorAllocate ($im, 233, 14, 91);
ImageString ($im, 1, 5, 5, "A Simple Text String", $text_color);
header ("Content-type: image/png");
ImagePng ($im);
?>
--> OK
for GD2 library :
$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);
--> I get :
Warning: imagecreatetruecolor(): requires GD 2.0 or later in /opt/hpws/apache/htdocs/info/testgd2.php on line 2
Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /opt/hpws/apache/htdocs/info/testgd2.php on line 3
I get gd library on :
http://hpux.asknet.de/hppd/hpux/Development/Libraries/gd-2.0.33/
If I change DEFINE('USE_TRUECOLOR',true); to false it does not work !!
With phpinfo.php :
GD Support enabled
GD Version 1.6.2 or higher
FreeType Support enabled
FreeType Linkage with freetype
T1Lib Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
I am disappointed !!
My GD library seems to be GD2 library but I do not why it is not possible to generate graphics ?
If anybody knows how to configure jpgraph whith HP-UX Apache, I will be very interested in.
Laurent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2005 08:07 AM
тАО05-11-2005 08:07 AM
Re: Apache, PHP and Images
I used all the depots that can be found in that porting archive and I'm using jpgraph on many hpux boxes.
Can yo post here the packages you installed and how you installed tham?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2005 11:50 AM
тАО05-11-2005 11:50 AM
Re: Apache, PHP and Images
>>> GD Support enabled
>>> GD Version 1.6.2 or higher
This tells me that PHP is picking up older version of GD from somewhere. It should say version 2.0 or higher.
What does the following command return?
# ldd -v /opt/hpws/apache/php/lib/php/extensions/gd.sl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2005 06:17 PM
тАО05-11-2005 06:17 PM
Re: Apache, PHP and Images
echo $SHLIB_PATH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2005 08:30 PM
тАО05-11-2005 08:30 PM
Re: Apache, PHP and Images
I joined file with results of ldd.
the share library gd.sl in /opt/hpws/apache/php/lib/php/extensions must be an old library (hpuxwsApache A.1.0.06.02 HP-UX Apache-based Web Server)
I installed new library gd 2.0.33 (libgd.sl in /usr/local/lib)
My apache configuration files :
php.ini :
extension_dir = /opt/hpws/apache/php/lib/php/extensions
extension=gd.sl
apachectl :
export SHLIB_PATH=$APACHE_PREFIX/php/lib/php/extensions:/usr/local/lib:$SHLIB_PATH
How can I set the new version of gd library in Apache ? I tried with symbolic link but it does not work.
I can upgrade my version of Apache server (I must check if gd2 library is available)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2005 10:24 PM
тАО05-11-2005 10:24 PM
Re: Apache, PHP and Images
Are you sure that libgd.sl in /usr/local/lob is the new one?
do:
what /usr/local/lib/libgd.sl
file /usr/local/lib/libgd.sl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2005 11:02 PM
тАО05-11-2005 11:02 PM
Re: Apache, PHP and Images
Yes,Alex
I checked with Software Installed (SAM) for product gd 2.0.33.
I get 3 libraries in /usr/local/lib :
libgd.a
libgd.la
libgd.sl
#file /usr/local/lib/libgd.sl
/usr/local/lib/libgd.sl: PA-RISC2.0 shared library
Now, I would like that apache and php use this library and not gd.sl which is set by HP-UX Apache.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2005 11:07 PM
тАО05-11-2005 11:07 PM
Re: Apache, PHP and Images
what /usr/local/lib/libgd.sl
gd.sl that is located under your apache is not the same thing as lidgd.sl.
gd.sl is a shared library of php, so php will be able to use GD installed on your system and libgd.sl is the GD itself, so you can't replase one with another, because they are different things.
If you run find for libgd.sl, do you get only "/ust/local/lib/libgd.sl" ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2005 11:16 PM
тАО05-11-2005 11:16 PM
Re: Apache, PHP and Images
for what :
#what /usr/local/lib/libgd.sl
/usr/local/lib/libgd.sl:
for find :
#find / -name "libgd.sl"
/usr/local/lib/libgd.sl
If I want to put good version of gd.sl library in php directory, How can I do ?
I download libraries from HP-UX Porting and Archive Centre of HP-UX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2005 11:29 PM
тАО05-11-2005 11:29 PM
Re: Apache, PHP and Images
When you rename libgd.sl to something else, do you have errors in error_log of apache?
This how we can be sure that it uses libgd.sl.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2005 11:54 PM
тАО05-11-2005 11:54 PM
Re: Apache, PHP and Images
http://www.hp.com/go/webserver
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2005 12:18 AM
тАО05-12-2005 12:18 AM
Re: Apache, PHP and Images
I did the test :
mv libgd.sl to libgd.sl.1
restart apache server
error_log :
[Thu May 12 14:10:51 2005] [notice] LDAP: Built with OpenLDAP LDAP SDK
[Thu May 12 14:10:51 2005] [notice] LDAP: SSL support unavailable
[Thu May 12 14:10:52 2005] [notice] Digest: generating secret for digest authentication ...
[Thu May 12 14:10:52 2005] [notice] Digest: done
[Thu May 12 14:10:52 2005] [notice] LDAP: Built with OpenLDAP LDAP SDK
[Thu May 12 14:10:52 2005] [notice] LDAP: SSL support unavailable
PHP Warning: Unable to load dynamic library '/opt/hpws/apache/php/lib/php/extensions/gd.sl' - Can't find path for shared library: lib
gd.sl in Unknown on line 0
[Thu May 12 14:10:52 2005] [notice] HP-UX_Apache-based_Web_Server/2.0.46 (Unix) DAV/2 PHP/4.2.3 configured -- resuming normal operatio
ns
Apache uses libgd.sl !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2005 12:48 AM
тАО05-12-2005 12:48 AM
Re: Apache, PHP and Images
I suspect there is some incompatibility between gd.sl and libgd.sl you have and php doesn't like it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2005 02:00 AM
тАО05-12-2005 02:00 AM
Re: Apache, PHP and Images
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2005 02:36 AM
тАО05-12-2005 02:36 AM
Re: Apache, PHP and Images
http://machine/info/testgd.php
What are the PHP errors that you get?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2005 02:55 AM
тАО05-12-2005 02:55 AM
Re: Apache, PHP and Images
$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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2005 03:28 AM
тАО05-12-2005 03:28 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2005 04:22 AM
тАО05-12-2005 04:22 AM
Re: Apache, PHP and Images
According to the message, you have a mistmatch in binaries. Did you install all the newest libraries? gd, libpng?
Never seen this message before.