From nobody@FreeBSD.org  Mon Mar  1 22:28:04 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 79010106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  1 Mar 2010 22:28:04 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 67FE98FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  1 Mar 2010 22:28:04 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o21MS4p6051672
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 1 Mar 2010 22:28:04 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o21MS4bv051671;
	Mon, 1 Mar 2010 22:28:04 GMT
	(envelope-from nobody)
Message-Id: <201003012228.o21MS4bv051671@www.freebsd.org>
Date: Mon, 1 Mar 2010 22:28:04 GMT
From: Dominic Fandrey <kamikaze@bsdforen.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: graphics/php5-gd does not load libpng
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         144403
>Category:       ports
>Synopsis:       graphics/php5-gd does not load libpng
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    dinoex
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 01 22:30:01 UTC 2010
>Closed-Date:    Sat Apr 10 10:42:23 CEST 2010
>Last-Modified:  Sat Apr 10 10:42:23 CEST 2010
>Originator:     Dominic Fandrey
>Release:        RELENG_8
>Organization:
private
>Environment:
FreeBSD mobileKamikaze.norad 8.0-STABLE FreeBSD 8.0-STABLE #1: Tue Feb 23 10:37:52 CET 2010     root@mobileKamikaze.norad:/usr/obj/HP6510b-8/amd64/usr/src/sys/HP6510b-8  amd64
>Description:
It appears that the PHP5 module /usr/local/lib/php/20060613/gd.so, at least on amd64, does not manage to load libpng.so.5, even though ldd is able to locate it.

This causes attempts to load PNG images to fail:
Warning: imagecreatefrompng() [function.imagecreatefrompng]: gd-png: fatal libpng error: [00][00][00][00]: unknown critical chunk in /usr/home/kamikaze/devel/workspace/realmsofsorrow/nightmare/core/nmTemplate.class.php on line 385
Warning: imagecreatefrompng() [function.imagecreatefrompng]: gd-png error: setjmp returns error condition in /usr/home/kamikaze/devel/workspace/realmsofsorrow/nightmare/core/nmTemplate.class.php on line 385
Warning: imagecreatefrompng() [function.imagecreatefrompng]: './templates/neo/layout/header_stretch.png' is not a valid PNG file in /usr/home/kamikaze/devel/workspace/realmsofsorrow/nightmare/core/nmTemplate.class.php on line 385

I expect that saving doesn't work as well, I didn't test it, though.

I do not know whether other platforms are affected. But 2 more people emailed me, that they have the same issue. Both mod_php and php are affected.

For more detail look at my post on ports@:
http://docs.freebsd.org/cgi/mid.cgi?4B8540AB.9040807
>How-To-Repeat:
Try to use PNG image functions with php5-gd on amd64.
>Fix:
I do not know how to fix this, but I am currently using a very clumsy workaround:

# env LD_PRELOAD=/usr/local/lib/libpng.so.5 /usr/local/etc/rc.d/apache22 restart

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->ale 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Mar 1 22:30:25 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=144403 

From: Dominic Fandrey <kamikaze@bsdforen.de>
To: bug-followup@FreeBSD.org, kamikaze@bsdforen.de
Cc:  
Subject: Re: ports/144403: graphics/php5-gd does not load libpng
Date: Sat, 06 Mar 2010 09:19:57 +0100

 This is an issue with php, not with the apache module:
 
 > php image.php
 Warning: imagecreatefrompng(): gd-png:  fatal libpng error: [00][00][00][00]: unknown critical chunk in /usr/home/kamikaze/devel/workspace/realmsofsorrow/image.php on line 68
 
 Warning: imagecreatefrompng(): gd-png error: setjmp returns error condition in /usr/home/kamikaze/devel/workspace/realmsofsorrow/image.php on line 68
 
 Warning: imagecreatefrompng(): 'templates/neo/layout/header_stretch.png' is not a valid PNG file in /usr/home/kamikaze/devel/workspace/realmsofsorrow/image.php on line 68
 
 ...
 
 
 The workaround works with direct php calls, too:
 
 > env LD_PRELOAD=libpng.so php image.php
 ... binary data ...
 
 The binary data amounts to a valid PNG image.
Responsible-Changed-From-To: ale->dinoex 
Responsible-Changed-By: dinoex 
Responsible-Changed-When: Mon Apr 5 20:31:40 CEST 2010 
Responsible-Changed-Why:  
I will take care of it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=144403 
State-Changed-From-To: open->closed 
State-Changed-By: dinoex 
State-Changed-When: Mon Apr 5 20:36:45 CEST 2010 
State-Changed-Why:  
Please try again after ports/145247 is fixed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=144403 

From: Dominic Fandrey <kamikaze@bsdforen.de>
To: dinoex@FreeBSD.org, bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/144403: graphics/php5-gd does not load libpng
Date: Mon, 05 Apr 2010 22:36:31 +0200

 On 05/04/2010 20:37, dinoex@FreeBSD.org wrote:
 > Synopsis: graphics/php5-gd does not load libpng
 > 
 > State-Changed-From-To: open->closed
 > State-Changed-By: dinoex
 > State-Changed-When: Mon Apr 5 20:36:45 CEST 2010
 > State-Changed-Why: 
 > Please try again after ports/145247 is fixed.
 > 
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=144403
 
 No change, the exact same behaviour as described.
 
 
 -- 
 A: Because it fouls the order in which people normally read text.
 Q: Why is top-posting such a bad thing?
 A: Top-posting.
 Q: What is the most annoying thing on usenet and in e-mail? 
State-Changed-From-To: closed->feedback 
State-Changed-By: dinoex 
State-Changed-When: Tue Apr 6 03:41:26 CEST 2010 
State-Changed-Why:  

Please make sure you have updated graphics/php5-gd. 
I have tested it under FreeBSD 8.0 amd64 can can not reproduce your problem. 

I suggest you rebuild apache and php and any other modules you have installed. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=144403 

From: Dominic Fandrey <kamikaze@bsdforen.de>
To: dinoex@FreeBSD.org, bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/144403: graphics/php5-gd does not load libpng
Date: Tue, 06 Apr 2010 09:02:31 +0200

 On 06/04/2010 03:43, dinoex@FreeBSD.org wrote:
 > Please make sure you have updated graphics/php5-gd.
 > I have tested it under FreeBSD 8.0 amd64 can can not reproduce your problem.
 
 I wish I was in your position in this. ;)
 
 > I suggest you rebuild apache and php and any other modules you have installed.
 
 Apache is not really involved, it was just the first point of
 recognition. Everything php has been rebuilt at least twice,
 though. And there is a change:
 
 > php image.php | hexdump -C | head -n3
 Abort (core dumped)  
 > echo $?
 134
 
 Obviously not the one I hoped for. The workaround still works:
 
 > env LD_PRELOAD=libpng.so php image.php | hexdump -C | head -n3
 00000000  89 50 4e 47 0d 0a 1a 0a  00 00 00 0d 49 48 44 52  |.PNG........IHDR|
 00000010  00 00 00 44 00 00 00 a6  08 06 00 00 00 63 9f 29  |...D.........c.)|
 00000020  3b 00 00 08 bb 49 44 41  54 78 9c ed 5d cd 92 1c  |;....IDATx..]...|
 
 Regards
 
 -- 
 A: Because it fouls the order in which people normally read text.
 Q: Why is top-posting such a bad thing?
 A: Top-posting.
 Q: What is the most annoying thing on usenet and in e-mail? 

From: dirk.meyer@dinoex.sub.org (Dirk Meyer)
To: bug-followup@FreeBSD.org, kamikaze@bsdforen.de
Cc:  
Subject: Re: ports/144403: graphics/php5-gd does not load libpng
Date: Tue, 06 Apr 2010 12:53:38 +0200

 Hallo Dominic Fandrey,
 
 > > I suggest you rebuild apache and php and any other modules you have installed.
 > 
 > Apache is not really involved, it was just the first point of
 > recognition. Everything php has been rebuilt at least twice,
 > though. And there is a change:
 > 
 > > php image.php | hexdump -C | head -n3
 > Abort (core dumped)  
 > > echo $?
 > 134
 
 Please provide more info about your apache/php installation.
 I aussume some of your extensions is in conflict.
 
 Deinstall all PHP exensions, use only php5-gd and try again.
 If the poblem vanish, please install your exensions one by one.
 
 
 # cat testphp5.php
     $file = '/root/play1.png';
     $a = GetImageSize($file);
     print_r ($a);
     $s = imagecreatefrompng($file); 
 
 # php -f testphp5.php
 Array
 (
     [0] => 400
     [1] => 400
     [2] => 3
     [3] => width="400" height="400"
     [bits] => 8
     [mime] => image/png
 )
 
 # ldd /usr/local/libexec/apache22/libphp5.so 
 /usr/local/libexec/apache22/libphp5.so:
         libcrypt.so.5 => /lib/libcrypt.so.5 (0x800882000)
         librt.so.1 => /usr/lib/librt.so.1 (0x800fc7000)
         libm.so.5 => /lib/libm.so.5 (0x8010cc000)
         libxml2.so.5 => /usr/local/lib/libxml2.so.5 (0x8011eb000)
         libz.so.5 => /lib/libz.so.5 (0x801439000)
         libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x80154e000)
         libc.so.7 => /lib/libc.so.7 (0x800647000)
 
 # ldd /usr/local/lib/php/20060613/gd.so 
 /usr/local/lib/php/20060613/gd.so:
         libt1.so.5 => /usr/local/lib/libt1.so.5 (0x800c00000)
         libfreetype.so.9 => /usr/local/lib/libfreetype.so.9 (0x800d5b000)
         libX11.so.6 => /usr/local/lib/libX11.so.6 (0x800edc000)
         libXpm.so.4 => /usr/local/lib/libXpm.so.4 (0x80110c000)
         libpng.so.6 => /usr/local/lib/libpng.so.6 (0x80121d000)
         libz.so.5 => /lib/libz.so.5 (0x801343000)
         libjpeg.so.11 => /usr/local/lib/libjpeg.so.11 (0x801458000)
         libc.so.7 => /lib/libc.so.7 (0x800647000)
         libm.so.5 => /lib/libm.so.5 (0x80158d000)
         libxcb.so.2 => /usr/local/lib/libxcb.so.2 (0x8016ac000)
         libXau.so.6 => /usr/local/lib/libXau.so.6 (0x8017c6000)
         libXdmcp.so.6 => /usr/local/lib/libXdmcp.so.6 (0x8018c9000)
         libpthread-stubs.so.0 => /usr/local/lib/libpthread-stubs.so.0 (0x8019ce000)
         librpcsvc.so.5 => /usr/lib/librpcsvc.so.5 (0x801acf000)
 
 
 kind regards Dirk
 
 - Dirk Meyer, Im Grund 4, 34317 Habichtswald, Germany
 - [dirk.meyer@dinoex.sub.org],[dirk.meyer@guug.de],[dinoex@FreeBSD.org]
 http://people.freebsd.org/~dinoex/errorlogs/

From: =?UTF-8?B?0JXQstCz0LXQvdC40Lkg0JrRgNC40LLQvtGA0YPRh9C60L4=?= <eugene@krivoruchko.info>
To: bug-followup@freebsd.org, kamikaze@bsdforen.de
Cc:  
Subject: Re: ports/144403: graphics/php5-gd does not load libpng
Date: Tue, 6 Apr 2010 16:03:04 +0400

 --00032555514a94a3820483903bb3
 Content-Type: text/plain; charset=KOI8-R
 Content-Transfer-Encoding: quoted-printable
 
 # ldd /usr/local/libexec/apache22/libphp5.so
 /usr/local/libexec/apache22/libphp5.so:
         libcrypt.so.5 =3D> /lib/libcrypt.so.5 (0x800db7000)
         librt.so.1 =3D> /usr/lib/librt.so.1 (0x800ed0000)
         libm.so.5 =3D> /lib/libm.so.5 (0x800fd5000)
         libxml2.so.5 =3D> /usr/local/lib/libxml2.so.5 (0x8010f4000)
         libz.so.5 =3D> /lib/libz.so.5 (0x80133e000)
         libiconv.so.3 =3D> /usr/local/lib/libiconv.so.3 (0x801453000)
         libc.so.7 =3D> /lib/libc.so.7 (0x800648000)
 
 # ldd /usr/local/lib/php/20060613/gd.so
 /usr/local/lib/php/20060613/gd.so:
         libt1.so.5 =3D> /usr/local/lib/libt1.so.5 (0x800b5e000)
         libfreetype.so.9 =3D> /usr/local/lib/libfreetype.so.9 (0x800cb8000)
         libX11.so.6 =3D> /usr/local/lib/libX11.so.6 (0x800e39000)
         libXpm.so.4 =3D> /usr/local/lib/libXpm.so.4 (0x801067000)
         libpng.so.6 =3D> /usr/local/lib/libpng.so.6 (0x801178000)
         libz.so.5 =3D> /lib/libz.so.5 (0x80129e000)
         libjpeg.so.11 =3D> /usr/local/lib/libjpeg.so.11 (0x8013b3000)
         libc.so.7 =3D> /lib/libc.so.7 (0x800648000)
         libm.so.5 =3D> /lib/libm.so.5 (0x8014e9000)
         libxcb.so.2 =3D> /usr/local/lib/libxcb.so.2 (0x801608000)
         libXau.so.6 =3D> /usr/local/lib/libXau.so.6 (0x801722000)
         libXdmcp.so.6 =3D> /usr/local/lib/libXdmcp.so.6 (0x801825000)
         libpthread-stubs.so.0 =3D> /usr/local/lib/libpthread-stubs.so.0
 (0x80192a000)
         librpcsvc.so.5 =3D> /usr/lib/librpcsvc.so.5 (0x801a2b000)
 
 After run # cat gd.php
 <?php
     $file =3D '/root/play1.png';
 
     $a =3D GetImageSize($file);
 
     print_r ($a);
 
     $s =3D imagecreatefrompng($file);
 ?>
 
 #php gd.php
 Abort (core dumped)
 
 Today install all patch and update!
 
 ---
 =F3 =D5=D7=C1=D6=C5=CE=C9=C5=CD,
 =EB=D2=C9=D7=CF=D2=D5=DE=CB=CF =E5=D7=C7=C5=CE=C9=CA
 
 em@il: eugene@krivoruchko.info
 icq: 244064173
 phone: +7 (926) 255-84-34
 msn: flex_idknet@msn.com
 skype: flexidk
 www: http://flipflip.ru/
 
 --00032555514a94a3820483903bb3
 Content-Type: text/html; charset=KOI8-R
 Content-Transfer-Encoding: quoted-printable
 
 # ldd /usr/local/libexec/apache22/libphp5.so<br>/usr/local/libexec/apache22=
 /libphp5.so:<br>=9A=9A=9A=9A=9A=9A=9A libcrypt.so.5 =3D&gt; /lib/libcrypt.s=
 o.5 (0x800db7000)<br>=9A=9A=9A=9A=9A=9A=9A librt.so.1 =3D&gt; /usr/lib/libr=
 t.so.1 (0x800ed0000)<br>=9A=9A=9A=9A=9A=9A=9A libm.so.5 =3D&gt; /lib/libm.s=
 o.5 (0x800fd5000)<br>
 
 =9A=9A=9A=9A=9A=9A=9A libxml2.so.5 =3D&gt; /usr/local/lib/libxml2.so.5 (0x8=
 010f4000)<br>=9A=9A=9A=9A=9A=9A=9A libz.so.5 =3D&gt; /lib/libz.so.5 (0x8013=
 3e000)<br>=9A=9A=9A=9A=9A=9A=9A libiconv.so.3 =3D&gt; /usr/local/lib/libico=
 nv.so.3 (0x801453000)<br>=9A=9A=9A=9A=9A=9A=9A libc.so.7 =3D&gt; /lib/libc.=
 so.7 (0x800648000)<br>
 
 <br># ldd /usr/local/lib/php/20060613/gd.so<br>/usr/local/lib/php/20060613/=
 gd.so:<br>=9A=9A=9A=9A=9A=9A=9A libt1.so.5 =3D&gt; /usr/local/lib/libt1.so.=
 5 (0x800b5e000)<br>=9A=9A=9A=9A=9A=9A=9A libfreetype.so.9 =3D&gt; /usr/loca=
 l/lib/libfreetype.so.9 (0x800cb8000)<br>
 
 =9A=9A=9A=9A=9A=9A=9A libX11.so.6 =3D&gt; /usr/local/lib/libX11.so.6 (0x800=
 e39000)<br>=9A=9A=9A=9A=9A=9A=9A libXpm.so.4 =3D&gt; /usr/local/lib/libXpm.=
 so.4 (0x801067000)<br>=9A=9A=9A=9A=9A=9A=9A libpng.so.6 =3D&gt; /usr/local/=
 lib/libpng.so.6 (0x801178000)<br>=9A=9A=9A=9A=9A=9A=9A libz.so.5 =3D&gt; /l=
 ib/libz.so.5 (0x80129e000)<br>
 
 =9A=9A=9A=9A=9A=9A=9A libjpeg.so.11 =3D&gt; /usr/local/lib/libjpeg.so.11 (0=
 x8013b3000)<br>=9A=9A=9A=9A=9A=9A=9A libc.so.7 =3D&gt; /lib/libc.so.7 (0x80=
 0648000)<br>=9A=9A=9A=9A=9A=9A=9A libm.so.5 =3D&gt; /lib/libm.so.5 (0x8014e=
 9000)<br>=9A=9A=9A=9A=9A=9A=9A libxcb.so.2 =3D&gt; /usr/local/lib/libxcb.so=
 .2 (0x801608000)<br>
 
 =9A=9A=9A=9A=9A=9A=9A libXau.so.6 =3D&gt; /usr/local/lib/libXau.so.6 (0x801=
 722000)<br>=9A=9A=9A=9A=9A=9A=9A libXdmcp.so.6 =3D&gt; /usr/local/lib/libXd=
 mcp.so.6 (0x801825000)<br>=9A=9A=9A=9A=9A=9A=9A libpthread-stubs.so.0 =3D&g=
 t; /usr/local/lib/libpthread-stubs.so.0 (0x80192a000)<br>
 
 =9A=9A=9A=9A=9A=9A=9A librpcsvc.so.5 =3D&gt; /usr/lib/librpcsvc.so.5 (0x801=
 a2b000)<br><br>After run # cat gd.php<br>&lt;?php<br>=9A=9A=9A $file =3D &#=
 39;/root/play1.png&#39;;<br><br>=9A=9A=9A $a =3D GetImageSize($file);<br><b=
 r>=9A=9A=9A print_r ($a);<br><br>
 =9A=9A=9A $s =3D imagecreatefrompng($file);<br>
 ?&gt;<br><br><span class=3D"quote1">#php gd.php</span><br>
 Abort (core dumped)  <br><br>Today install all patch and update!<br><br cle=
 ar=3D"all">---<br>=F3 =D5=D7=C1=D6=C5=CE=C9=C5=CD,<br>=EB=D2=C9=D7=CF=D2=D5=
 =DE=CB=CF =E5=D7=C7=C5=CE=C9=CA<br><br>em@il: <a href=3D"mailto:eugene@kriv=
 oruchko.info" target=3D"_blank">eugene@krivoruchko.info</a><br>
 
 icq: 244064173<br>phone: +7 (926) 255-84-34<br>msn: <a href=3D"mailto:flex_=
 idknet@msn.com" target=3D"_blank">flex_idknet@msn.com</a><br>
 skype: flexidk<br>www: <a href=3D"http://flipflip.ru/" target=3D"_blank">ht=
 tp://flipflip.ru/</a><br>
 
 --00032555514a94a3820483903bb3--

From: "Eugene Krivoruchko" <admin@presidentpmr.org>
To: <bug-followup@FreeBSD.org>, <kamikaze@bsdforen.de>
Cc:  
Subject: Re: ports/144403: graphics/php5-gd does not load libpng
Date: Tue, 6 Apr 2010 15:56:26 +0400

 This is a multi-part message in MIME format.
 
 ------=_NextPart_000_0012_01CAD5A1.BBB458D0
 Content-Type: text/plain;
 	charset="us-ascii"
 Content-Transfer-Encoding: 7bit
 
 Today I rebuild php from ports
 
 Today in /usr/ports/graphics/php5-gd/files/ add file  "patch-libgd_gd_png.c"
 
 After rebuild I have Abort (core dumped).
 
 My configure: FreeBSD 8.0, PHP 5.2.12_2
 
 What need doing to fix this error?
 
 ImageMagick work perfect with PNG file
 
 
 ------=_NextPart_000_0012_01CAD5A1.BBB458D0
 Content-Type: text/html;
 	charset="us-ascii"
 Content-Transfer-Encoding: quoted-printable
 
 <html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
 xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
 xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
 xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
 xmlns=3D"http://www.w3.org/TR/REC-html40">
 
 <head>
 <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
 charset=3Dus-ascii">
 <meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
 <style>
 <!--
  /* Font Definitions */
  @font-face
 	{font-family:"Cambria Math";
 	panose-1:2 4 5 3 5 4 6 3 2 4;}
 @font-face
 	{font-family:Calibri;
 	panose-1:2 15 5 2 2 2 4 3 2 4;}
  /* Style Definitions */
  p.MsoNormal, li.MsoNormal, div.MsoNormal
 	{margin:0cm;
 	margin-bottom:.0001pt;
 	font-size:11.0pt;
 	font-family:"Calibri","sans-serif";}
 a:link, span.MsoHyperlink
 	{mso-style-priority:99;
 	color:blue;
 	text-decoration:underline;}
 a:visited, span.MsoHyperlinkFollowed
 	{mso-style-priority:99;
 	color:purple;
 	text-decoration:underline;}
 span.a
 	{mso-style-type:personal-compose;
 	font-family:"Calibri","sans-serif";
 	color:windowtext;}
 .MsoChpDefault
 	{mso-style-type:export-only;}
 @page Section1
 	{size:612.0pt 792.0pt;
 	margin:2.0cm 42.5pt 2.0cm 3.0cm;}
 div.Section1
 	{page:Section1;}
 -->
 </style>
 <!--[if gte mso 9]><xml>
  <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
 </xml><![endif]--><!--[if gte mso 9]><xml>
  <o:shapelayout v:ext=3D"edit">
   <o:idmap v:ext=3D"edit" data=3D"1" />
  </o:shapelayout></xml><![endif]-->
 </head>
 
 <body lang=3DRU link=3Dblue vlink=3Dpurple>
 
 <div class=3DSection1>
 
 <p class=3DMsoNormal><span lang=3DEN-US>Today I rebuild php from =
 ports<o:p></o:p></span></p>
 
 <p class=3DMsoNormal><span lang=3DEN-US>Today in =
 /usr/ports/graphics/php5-gd/files/
 add file &nbsp;&#8220;patch-libgd_gd_png.c&#8221;<o:p></o:p></span></p>
 
 <p class=3DMsoNormal><span lang=3DEN-US>After rebuild I have Abort (core =
 dumped).<o:p></o:p></span></p>
 
 <p class=3DMsoNormal><span lang=3DEN-US>My configure: FreeBSD 8.0, PHP =
 5.2.12_2<o:p></o:p></span></p>
 
 <p class=3DMsoNormal><span lang=3DEN-US>What need doing to fix this =
 error?<o:p></o:p></span></p>
 
 <p class=3DMsoNormal><span lang=3DEN-US>ImageMagick work perfect with =
 PNG file<o:p></o:p></span></p>
 
 </div>
 
 </body>
 
 </html>
 
 ------=_NextPart_000_0012_01CAD5A1.BBB458D0--
 

From: Dominic Fandrey <kamikaze@bsdforen.de>
To: Dirk Meyer <dirk.meyer@dinoex.sub.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/144403: graphics/php5-gd does not load libpng
Date: Tue, 06 Apr 2010 19:31:11 +0200

 On 06/04/2010 12:53, Dirk Meyer wrote:
 > Hallo Dominic Fandrey,
 > 
 >>> I suggest you rebuild apache and php and any other modules you have installed.
 >>
 >> Apache is not really involved, it was just the first point of
 >> recognition. Everything php has been rebuilt at least twice,
 >> though. And there is a change:
 >>
 >>> php image.php | hexdump -C | head -n3
 >> Abort (core dumped)  
 >>> echo $?
 >> 134
 > 
 > Please provide more info about your apache/php installation.
 > I aussume some of your extensions is in conflict.
 
 # pkg_info -Ex php
 php5-5.2.12_2
 php5-gd-5.2.12_2
 
 > Deinstall all PHP exensions, use only php5-gd and try again.
 > If the poblem vanish, please install your exensions one by one.
 
 Done, no change.
 
 > # cat testphp5.php
 >     $file = '/root/play1.png';
 >     $a = GetImageSize($file);
 >     print_r ($a);
 >     $s = imagecreatefrompng($file); 
 > 
 > # php -f testphp5.php
 > Array
 > (
 >     [0] => 400
 >     [1] => 400
 >     [2] => 3
 >     [3] => width="400" height="400"
 >     [bits] => 8
 >     [mime] => image/png
 > )
 
 # php -f testphp5.php
 Array
 (
     [0] => 2560
     [1] => 1600
     [2] => 3
     [3] => width="2560" height="1600"
     [bits] => 8
     [mime] => image/png
 )
 Abort (core dumped)
 # echo $?
 134
 
 
 # env LD_PRELOAD=libpng.so php -f testphp5.php
 Array
 (
     [0] => 2560
     [1] => 1600
     [2] => 3
     [3] => width="2560" height="1600"
     [bits] => 8
     [mime] => image/png
 )
 
 Note the lack of a core dump.
 
 > # ldd /usr/local/lib/php/20060613/gd.so 
 
 /usr/local/lib/php/20060613/gd.so:
 	libt1.so.5 => /usr/local/lib/libt1.so.5 (0x800c00000)
 	libfreetype.so.9 => /usr/local/lib/libfreetype.so.9 (0x800d58000)
 	libX11.so.6 => /usr/local/lib/libX11.so.6 (0x800ed5000)
 	libXpm.so.4 => /usr/local/lib/libXpm.so.4 (0x8010fd000)
 	libpng.so.6 => /usr/local/lib/libpng.so.6 (0x80120d000)
 	libz.so.5 => /lib/libz.so.5 (0x801332000)
 	libjpeg.so.11 => /usr/local/lib/libjpeg.so.11 (0x801446000)
 	libc.so.7 => /lib/libc.so.7 (0x800645000)
 	libm.so.5 => /lib/libm.so.5 (0x801582000)
 	libxcb.so.2 => /usr/local/lib/libxcb.so.2 (0x8016a1000)
 	libXau.so.6 => /usr/local/lib/libXau.so.6 (0x8017ba000)
 	libXdmcp.so.6 => /usr/local/lib/libXdmcp.so.6 (0x8018bc000)
 	librpcsvc.so.5 => /usr/lib/librpcsvc.so.5 (0x8019c1000)
 	libpthread-stubs.so.0 => /usr/local/lib/libpthread-stubs.so.0 (0x801ac9000)
 
 Regards
 
 -- 
 A: Because it fouls the order in which people normally read text.
 Q: Why is top-posting such a bad thing?
 A: Top-posting.
 Q: What is the most annoying thing on usenet and in e-mail? 

From: Dominic Fandrey <kamikaze@bsdforen.de>
To: bug-followup@FreeBSD.org, kamikaze@bsdforen.de
Cc:  
Subject: Re: ports/144403: graphics/php5-gd does not load libpng
Date: Sat, 10 Apr 2010 09:16:38 +0200

 The problem is gone with the switch to the php-5.3 branch.
 
 Thank you all for your time and efforts!
State-Changed-From-To: feedback->closed 
State-Changed-By: dinoex 
State-Changed-When: Sat Apr 10 10:42:01 CEST 2010 
State-Changed-Why:  
problem solved 

http://www.freebsd.org/cgi/query-pr.cgi?pr=144403 
>Unformatted:
