<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Coyote Tracks &#187; PEAR</title>
	<atom:link href="http://kagan.mactane.org/blog/tag/pear/feed/" rel="self" type="application/rss+xml" />
	<link>http://kagan.mactane.org/blog</link>
	<description>The prints of an Internet-enabled coyote.</description>
	<lastBuildDate>Tue, 31 Jan 2012 03:26:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Workaround for PEAR/PECL Failure with Message &#8220;ERROR: `phpize&#8217; failed&#8221;</title>
		<link>http://kagan.mactane.org/blog/2009/05/11/workaround-for-pearpecl-failure-with-message-error-phpize-failed/</link>
		<comments>http://kagan.mactane.org/blog/2009/05/11/workaround-for-pearpecl-failure-with-message-error-phpize-failed/#comments</comments>
		<pubDate>Mon, 11 May 2009 17:24:24 +0000</pubDate>
		<dc:creator>Kai MacTane</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[PEAR]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[solution]]></category>

		<guid isPermaLink="false">http://kai.mactane.org/blog/?p=46</guid>
		<description><![CDATA[When you try to upgrade or install various PEAR (or PECL) packages, you may get the rather unhelpful error message &#8220;ERROR: `phpize&#8217; failed&#8221;. For example, here&#8217;s the result I get when I try to install the pecl_http package: root@finrod:~# pecl install pecl_http pecl/pecl_http can optionally use PHP extension &#34;iconv&#34; downloading pecl_http-1.6.3.tar .&#46;. Starting to download [...]]]></description>
			<content:encoded><![CDATA[<p>When you try to upgrade or install various PEAR (or PECL) packages, you may get the rather unhelpful error message &#8220;ERROR: `phpize&#8217; failed&#8221;. For example, here&#8217;s the result I get when I try to install the <code>pecl_http</code> package:</p>
<p><code>root@finrod:~# <strong>pecl install pecl_http</strong><br />
pecl/pecl_http can optionally use PHP extension &#34;iconv&#34;<br />
downloading pecl_http-1.6.3.tar .&#46;.<br />
Starting to download pecl_http-1.6.3.tar (Unknown size)<br />
.&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;.&#46;.<br />
.&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;.&#46;.<br />
.&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;..&#46;.&#46;.done: 1,015,808 bytes<br />
71 source files, building<br />
running: phpize<br />
Configuring for:<br />
PHP Api Version:         20041225<br />
Zend Module Api No:      20060613<br />
Zend Extension Api No:   220060519<br />
ERROR: `phpize&#39; failed<br />
root@finrod:~#</code></p>
<p>The error is actually caused by <a href="http://bugs.php.net/bug.php?id=29123">a bug in PHP itself (filed in PHP&#8217;s bug database as of 2004</a>, and currently marked &#8220;Won&#8217;t fix&#8221;): If your installation of PHP was compiled with the <code>--enable-sigchild</code> flag on, then the return value from a <code>pclose()</code> call can&#8217;t be trusted. One of PEAR&#8217;s components, called PEAR::Builder, uses <code>pclose()</code> as part of the package installation process, to try to determine whether a given operation succeeded or not.</p>
<p>Even though the operation succeeds, <code>pclose()</code> returns -1, signaling a failure, and the rest of PEAR then takes <code>pclose()</code> at its word.</p>
<p><strong>Is This Affecting Your Installation of PHP and PEAR?</strong></p>
<p>If you&#8217;ve gotten an &#8220;ERROR: `phpize&#8217; failed&#8221; message when trying to run a &#8220;pecl install&#8221; or &#8220;pear install&#8221; command, try running <code>phpinfo()</code>&nbsp;&mdash; if you see <code>--enable-sigchild</code> in the &#8220;Configure Command&#8221; section near the very top, then you&#8217;re most likely being bitten by this bug.</p>
<p><strong>Potential Fixes and Workarounds</strong></p>
<p>The PHP dev team recommends recompiling without the offending flag.</p>
<p>However, you may not be able to do that, for any of various reasons. (You may have installed from a binary package, for instance&nbsp;&mdash; like most people these days.) Or it may simply seem like an excessive hassle. I offer the following patch <strong>as-is, without any guarantee or support</strong>.</p>
<p>First, ensure that you have the latest version of PEAR::Builder. Look in your PEAR/Builder.php file&nbsp;&mdash; On most Linux and Unix installations, this is likely to be in <code>/usr/lib/php/PEAR/Builder.php</code>, or possibly <code>/usr/local/lib/php/PEAR/Builder.php</code>.</p>
<p>On Windows systems, PHP might be installed nearly anywhere, but supposing it&#8217;s in <code>c:\php</code>, then the file you&#8217;re looking for will be in <code>c:\php\PEAR\PEAR\Builder.php</code> (yes, that&#8217;s two PEARs in a row).</p>
<p>Check the &#8220;@version&#8221; line in the big comment block at the beginning of the file; the line you want should be around line 19 or so. If says it&#8217;s less than version 1.38 (the latest one, at the time I&#8217;m writing this post), then try upgrading. Running &#8220;pear upgrade pear&#8221; should work. Then you can install this patch file:</p>
<p><a href="http://kai.mactane.org/software/patch-pear-builder-1.38.txt">patch-pear-builder-1.38.txt</a></p>
<p>Download the patch file and place it somewhere on your machine. Log in and <code>cd</code> to the PEAR directory that contains the Builder.php file. Then run the patch command. In the following example, I&#8217;ve placed the patch file in root&#8217;s home directory:</p>
<p><code>root@finrod:~# <strong>ls</strong><br />
loadlin16c.txt  loadlin16c.zip  patch-pear-builder-1.38.txt<br />
root@finrod:~# <strong>cd /usr/lib/php/PEAR</strong><br />
root@finrod:/usr/lib/php/PEAR# <strong>cp Builder.php Builder.bak.php</strong><br />
root@finrod:/usr/lib/php/PEAR# <strong>patch -p0 < /root/patch-pear-builder-1.38.txt</strong><br />
patching file Builder.php<br />
root@finrod:/usr/lib/php/PEAR# </code></p>
<p>Naturally, if the patch file doesn&#8217;t work for some reason, or it breaks things, you can just <code>cp</code> the backup file back into place.</p>
<p>Please let me know if this patch works for you&nbsp;&mdash; or if it fails horribly, for that matter.</p>
<p>[Updated 2009-06-03: Minor edits for clarity]</p>
]]></content:encoded>
			<wfw:commentRss>http://kagan.mactane.org/blog/2009/05/11/workaround-for-pearpecl-failure-with-message-error-phpize-failed/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
	</channel>
</rss>

