Wrox Programmer Forums
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 25th, 2004, 04:25 AM
Registered User
 
Join Date: Apr 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Php and libpng

I do not know how to install libpng and zlib (in Windows) for php. I have downloaded files for libpng and zlib, but I do not how to install them to be able to create images with PHP.

Martin

 
Old April 27th, 2004, 06:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

zlib functionality is built-in to PHP on windows. you don't need to enable any extensions. libpng is built-in to the GD library that ships with PHP. Just enable gd2.

The PHP zip-file distribution contains all the DLLs necessary to load any of the available extensions, including gd2.


Take care,

Nik
http://www.bigaction.org/
 
Old April 28th, 2004, 12:54 PM
Registered User
 
Join Date: Apr 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank You NiK for you answer,

I have this code from textbook and I still cannot see a picture.
<?php


 $height=200;
 $width=200;
 $im=imagecreate($width, $height);
 $white=imagecolorallocate($im, 255, 255, 255);
 $black=imagecolorallocate($im, 0, 0, 0);


 imagefill($im, 0,0, $black);
 imageline($im, 0, 0, $width. $height, $white);

    Header("Content-type: image/png");
 imagepng($im);
 imagedestroy($im);
?>

 I have gd2 in php instalation. and I have made extension for gd2 in php.ini accesible but if I want to see it in IE 6 I just see mark for the image (small red cross) and no image. (or I can read:
Warning: Cannot modify header information - headers already sent by (output started at E:\PHPfiles\obrazky\obr1.php:2) in E:\PHPfiles\obrazky\obr1.php on line 15)

If you have any idea what I am doing wrong please let me know.

Thanks Martin


 
Old April 28th, 2004, 08:26 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are you seeing any error messages? If not, look for whitespace outside of your <?php tag. Any text outside of the <?php and ?> tags are considered text output sent to the user. If PHP encounters any output, then it'll send the default HTTP headers to the client and begin sending output. Once that's done, you CANNOT send new header information, such as the Content-type.

Also, you should verify that GD is enabled by looking for it in the phpinfo() output.


Take care,

Nik
http://www.bigaction.org/
 
Old April 29th, 2004, 01:46 PM
Registered User
 
Join Date: Apr 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Nik,

You are right the problem was in the whitespace,

Once more thank you,

Martin






Similar Threads
Thread Thread Starter Forum Replies Last Post
Beg. PHP 5 > Ch. 11 - fetch_field.php crater BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 January 2nd, 2007 12:20 PM
PHP Warning: PHP Startup: Unable to load dynamic l surendran Beginning PHP 1 May 29th, 2006 08:49 AM
begin php & mysql - chapter 12, user_form.php jon_stubber Beginning PHP 1 March 9th, 2006 10:57 AM
Error: movie.php & commit.php on p182-186, ch6 willburke BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 October 12th, 2004 02:48 PM
Ch. 1: PHP Installation Troubles: php3 vs php manjito BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 4 June 12th, 2003 03:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.