<?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>Tom Sartain &#124; Blog &#187; php</title>
	<atom:link href="http://blog.ummwhat.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ummwhat.com</link>
	<description></description>
	<lastBuildDate>Fri, 20 Jan 2012 20:01:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Apache, PHP, Snow Leopard and Oracle conspired to kill me, but I didn&#8217;t let them!</title>
		<link>http://blog.ummwhat.com/2009/10/apache-php-snow-leopard-and-oracle-conspired-to-kill-me-but-i-didnt-let-them/</link>
		<comments>http://blog.ummwhat.com/2009/10/apache-php-snow-leopard-and-oracle-conspired-to-kill-me-but-i-didnt-let-them/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 18:23:22 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[osx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[oci8]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://blog.ummwhat.com/?p=3375</guid>
		<description><![CDATA[In a nice epilogue to my post about how Apache, PHP, Zend Debugger and Snow Leopard are conspiring to kill me, I have good news! Thanks to Zend&#8217;s release of a 64-bit version of the Zend Debugger for Mac OSX, I finally got to get everything working together nicely in 64-bit world. I ended up [...]]]></description>
			<content:encoded><![CDATA[<p>In a nice epilogue to my post about how <a href="http://blog.ummwhat.com/2009/09/apache-php-zend-debugger-and-snow-leopard-are-conspiring-to-kill-me/">Apache, PHP, Zend Debugger and Snow Leopard are conspiring to kill me</a>, I have good news!</p>
<p>Thanks to Zend&#8217;s release of a <a href="http://www.zend.com/en/products/studio/downloads">64-bit version of the Zend Debugger for Mac OSX</a>, I finally got to get everything working together nicely in 64-bit world. </p>
<p>I ended up doing a complete format and re-install of Snow Leopard, since I had too many 32-bit binaries laying around. This gave me a great opportunity to clean up my computer too. Double win! </p>
<p>Along the way, I had a couple of hurdles&#8230;</p>
<ul>
<li>iconv continued to throw defined symbol errors. Tried <a href="http://jspr.tndy.me/2009/07/php-5-3-iconv-osx-symbols-missing-_libiconv/">manually compiling iconv in 64-bit</a> but that didn&#8217;t work, eventually just went with a <a href="http://www.macports.org/">Macports</a> install and that worked. Also, tacked &#8220;-liconv&#8221; to the end of my EXTRA_LIBS in the Makefile. For good measure.</li>
<li>Tacked &#8220;-lresolv&#8221; to the end of EXTRA_LIBS in the Makefile too, thanks to <a href="http://www.firewing1.com/node/31">this handy PHP on Snow Leopard reference</a></li>
<li>I used Macports to install the GD related stuff, since the native OSX build of PHP references were broken</li>
<li>We use Oracle as a backend at work, and I had gotten the Oracle Instant Client working on my Leopard build but was having a hell of a time getting it working on Snow Leopard.</li>
</ul>
<p>All of this repeated many times over the past couple of days, trying to get OCI8 to work properly:</p>
<ul>
<li><a href="http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/intel_macsoft.html">Downloaded the Instant Client Basic, SDK and SQL*Plus from Oracle</a></li>
<li>Unpacked them all into /opt/oracle/instantclient_10_2</li>
<li>Recompiled PHP with &#8220;&#8211;with-oci8=instantclient,/opt/oracle/instantclient_10_2,10.2&#8243;</li>
<li>Got lots and lots of &#8220;PHP Warning:  ocilogon(): OCIEnvNlsCreate() failed. There is something wrong with your system &#8211; please check that DYLD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries&#8221;</li>
<li>Tried setting the environment variables via
<ul>
<li>Bash shell</li>
<li>/etc/profile</li>
<li><a href="http://httpd.apache.org/docs/2.0/mod/mod_env.html#setenv">SetEnv</a> in the Apache configs</li>
<li><a href="http://php.net/putenv">putenv()</a> on the script</li>
<li>Voodoo</li>
</ul>
<p>        But none of it worked.
    </li>
</ul>
<p>The problem was that I had made the decision to use the default install of Apache that came with OSX, which has ever so slightly different rules associated with it.</p>
<p>Eventually, I found out about plist files, and how OSX&#8217;s Apache ends up caring about them. So a quick addition to /System/Library/LaunchDaemons/org.apache.httpd.plist and an Apache restart later and my DYLD_LIBRARY_PATH woes were over!</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE plist PUBLIC &quot;-//Apple Computer//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plist</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Disabled<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;true</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Label<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.apache.httpd<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ProgramArguments<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/usr/sbin/httpd<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>-D<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>FOREGROUND<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>OnDemand<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;false</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>SHAuthorizationRight<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>system.preferences<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>EnvironmentVariables<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>DYLD_LIBRARY_PATH<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/opt/oracle/instantclient_10_2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>TNS_ADMIN<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/opt/oracle/tns<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plist<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>By adding lines 19 to 25, the environment variables given are passed along to PHP via Apache and eventually the Oracle Instant Client.</p>
<hr />
<p>Other than the OCI issues, the recompiling of PHP went smoothly. Of course, this is in large part thanks to what I learned on my previous adventures in PHP OSX compilation. I&#8217;d still like to know more about .plist files, but for now, I&#8217;m happy that I&#8217;m back up and running where I need to be.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ummwhat.com/2009/10/apache-php-snow-leopard-and-oracle-conspired-to-kill-me-but-i-didnt-let-them/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache, PHP, Zend Debugger and Snow Leopard are conspiring to kill me</title>
		<link>http://blog.ummwhat.com/2009/09/apache-php-zend-debugger-and-snow-leopard-are-conspiring-to-kill-me/</link>
		<comments>http://blog.ummwhat.com/2009/09/apache-php-zend-debugger-and-snow-leopard-are-conspiring-to-kill-me/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 18:59:16 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[osx]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.ummwhat.com/?p=3349</guid>
		<description><![CDATA[After an OS upgrade to Snow Leopard, I find myself unable to rebuild PHP. iconv still throws undefined symbol errors. This is no longer fixable by adding -liconv to the EXTRA_LIBS in the Makefile MH_BUNDLE_FLAGS needs to be moved to the end of the group at line 155 otherwise I get more undefined errors After [...]]]></description>
			<content:encoded><![CDATA[<p>After an OS upgrade to Snow Leopard, I find myself unable to rebuild PHP.</p>
<ul>
<li>iconv <a href="http://bugs.php.net/bug.php?id=43189">still</a> <a href="http://bugs.php.net/bug.php?id=48195">throws</a> <a href="http://jspr.tndy.me/2009/07/php-5-3-iconv-osx-symbols-missing-_libiconv/">undefined symbol errors</a>. This is no longer fixable by adding -liconv to the EXTRA_LIBS in the Makefile</li>
<li><a href="http://blog.yimingliu.com/2009/02/24/missing-library-symbols-while-compiling-php-528/">MH_BUNDLE_FLAGS needs to be moved</a> to the end of the group at line 155 otherwise I get more undefined errors</li>
<li>After giving up on doing it manually, <a href="http://www.macports.org/">Macports </a>install of tidy gives a fatal error about lazy symbol binding failing</li>
<li>Many of my libraries were built as 32-bit, though this was easy to rectify</li>
<li>Even after giving up on iconv and tidy, ZendDebugger is not available for 64-bit on OSX yet. At least, <a href="http://dmitry-dulepov.com/article/zend-debugger-goes-64-bit-on-mac-os-x.html">not that I can get to</a>.</li>
</ul>
<p>That last one is the kicker, since I really enjoy having the debugger so well integrated with Zend Studio 5.5.</p>
<p>So for the time being, it looks like I&#8217;ll be staying with the install I&#8217;ve got. Unless Zend releases a 64-bit version for OSX, my next step will be to figure out how to compile as 32-bit so I can retain control over my install. </p>
<p>Entirely too many hours spent on getting this to work, and I end up using Time Machine to restore my old install. Hooray for frequent backups though. Otherwise I&#8217;d have had to recompile all of my old libraries as 32-bit. And that would have been the end of me.</p>
<hr />
<p>Update: <a href="http://blog.ummwhat.com/2009/10/apache-php-snow-leopard-and-oracle-conspired-to-kill-me-but-i-didnt-let-them/">Success!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ummwhat.com/2009/09/apache-php-zend-debugger-and-snow-leopard-are-conspiring-to-kill-me/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

