<?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>DLMax &#187; php</title>
	<atom:link href="http://dlmax.org/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://dlmax.org</link>
	<description>Max Westen's ramblings on OSX and PHP</description>
	<lastBuildDate>Tue, 26 Jan 2010 20:58:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Goodbye Ibuildings, Hi Rhinofly</title>
		<link>http://dlmax.org/2010/01/26/goodbye-ibuildings-hi-rhinofly/</link>
		<comments>http://dlmax.org/2010/01/26/goodbye-ibuildings-hi-rhinofly/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 20:46:20 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[personal]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ibuildings]]></category>
		<category><![CDATA[rhinofly]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://dlmax.org/?p=241</guid>
		<description><![CDATA[After being part of their highly skilled team for over 17 months I&#8217;ve decided to leave Ibuildings. I&#8217;d like to thank Ivo for believing in me and helping me out if needed.
I&#8217;ve learned a lot and it&#8217;s been a privilege to work there.
Starting the first of March I&#8217;ll be developing in ColdFusion and PHP at [...]]]></description>
			<content:encoded><![CDATA[<p>After being part of their highly skilled team for over 17 months I&#8217;ve decided to leave <a href="http://www.ibuildings.com">Ibuildings</a>. I&#8217;d like to thank <a href="http://www.jansch.nl/">Ivo</a> for believing in me and helping me out if needed.<br />
I&#8217;ve learned a lot and it&#8217;s been a privilege to work there.</p>
<p>Starting the first of March I&#8217;ll be developing in ColdFusion and PHP at <a href="http://rhinofly.nl/">Rhinlofly</a>.<br />
I hereby like to thank my family and <a href="http://www.thinkerpublications.com/">Cal</a>, <a href="http://twitter.com/Koopmanschap">Jouri</a> and <a href="http://rc6.org/">Remco</a> for their support in the process of finalizing my decision to switch jobs.</p>

	Tags: <a href="http://dlmax.org/tag/ibuildings/" title="ibuildings" rel="tag">ibuildings</a>, <a href="http://dlmax.org/tag/personal/" title="personal" rel="tag">personal</a>, <a href="http://dlmax.org/tag/php/" title="php" rel="tag">php</a>, <a href="http://dlmax.org/tag/rhinofly/" title="rhinofly" rel="tag">rhinofly</a>, <a href="http://dlmax.org/tag/work/" title="work" rel="tag">work</a><br />
]]></content:encoded>
			<wfw:commentRss>http://dlmax.org/2010/01/26/goodbye-ibuildings-hi-rhinofly/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Developing in PHP with NetBeans 6.8</title>
		<link>http://dlmax.org/2009/11/25/developing-in-php-with-netbeans/</link>
		<comments>http://dlmax.org/2009/11/25/developing-in-php-with-netbeans/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 00:05:34 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://dlmax.org/?p=222</guid>
		<description><![CDATA[The problem:
I love Textmate as an editor period.
There are some things though that I started missing while developing:

Code completion
Inline documentation
instant error checking
debugging from my editor
must have strong syntax highlighting support (for dark themes like my favourite Sunburst)

So I started looking around for an IDE(or Editor) that would work for me and that I could adhere [...]]]></description>
			<content:encoded><![CDATA[<h3>The problem:</h3>
<p>I love <a href="http://macromates.com">Textmate</a> as an editor period.</p>
<p>There are some things though that I started missing while developing:</p>
<ul>
<li>Code completion</li>
<li>Inline documentation</li>
<li>instant error checking</li>
<li>debugging from my editor</li>
<li>must have strong syntax highlighting support (for dark themes like my favourite <a href="http://wiki.macromates.com/Themes/UserSubmittedThemes#sunburst">Sunburst</a>)</li>
</ul>
<p>So I started looking around for an IDE(or Editor) that would work for me and that I could adhere to.</p>
<h3>The contestants:</h3>
<h4>VIM:</h4>
<p>I&#8217;ve heard a lot on <a href="http://www.vim.org">VIM</a> and really like the application. When you add a couple of plugins like <a href="http://www.vim.org/scripts/script.php?script_id=69">Project</a>, <a href="http://www.vim.org/scripts/script.php?script_id=956">PHP-Doc</a>, <a href="http://www.vim.org/scripts/script.php?script_id=2754">DelimitMate</a>, <a href="http://www.vim.org/scripts/script.php?script_id=2540">SnipMate</a> and <a href="http://gist.github.com/166145">Sunburst</a> you can accomplish most of these tasks.<br />
An added feature is that you can configure VIM to work the same on your remote systems too, so it virtually doesn&#8217;t matter if you&#8217;re on Mac, Windows or Linux or working trough an SSH connection; your editor functions and looks the same.<br />
Most features from my list can be accomplished in VIM, but I can&#8217;t get used to the shortcuts. There are a lot of them and all of them are new compared to windows/mac users. If you&#8217;re in a full-time development job i think it&#8217;s very difficult to learn the new way of working and still deliver on time. So for me VIM isn&#8217;t something that can be used out of the box.</p>
<h4>Eclipse PDT:</h4>
<p><a href="http://www.eclipse.org/pdt">Eclipse with PDT 2.1</a> is another IDE I hear a lot of good comments on. All of the things I want to see in an alternative editor/IDE is there, except for the strong Syntax highlighting and easy themeing. Colours can be changed, but have to be changed on a lot of different locations, making it hard to do consistently. The PDT plugin has some nice features, but the syntax highlighting could be much better. Eclipse with PDT isn&#8217;t my thing because of the lack of syntax highlighting features, the difficult themeing (especially to darker themes) and the high memory consumption.</p>
<h4>Aptana</h4>
<p><a href="http://www.aptana.org">Aptana Studio 2.0</a> is a good IDE (I&#8217;ve used it before) with a very nice PHP plugin, but changed to use the PDT eclipse plugin. There is a way to use the older PHP plugin, but because development on that plugin has ceased, I don&#8217;t recommend it. The PDT plugin with Aptana has lacks the same points as discussed above under &#8220;Eclipse PDT&#8221;.</p>
<h4>Zend Studio:</h4>
<p><a href="http://www.zend.com/products/studio">Zend Studio 7.1</a> basically is Eclipse with the PDT plugin and some added features; specifically focussed on &#8220;Zend Framework&#8221;, &#8220;Zend Server&#8221; and &#8220;Zend Debugger&#8221;. Zend Studio isn&#8217;t a fit for me, because the problems I have with the Eclipse PDT plugin are the features taken from this plugin. If these points would improve it would be a good choice for me. The price could be a turnoff though if a free IDE is available that can do most you need.</p>
<h4>Komodo IDE:</h4>
<p><a href="http://www.activestate.com/komodo">Komodo IDE 5.2</a> is a stable IDE and has a smaller memory footprint then the eclipse based tools. It has support for a multitude of languages, VCS(=Version Control Systems). The support for PHP and debugging are good and this is one of the few IDEs that are quite easy to style in a dark background. There are only 2 downsides for me; the price and the syntax highlighting could be even better. The price isn&#8217;t that high for a business, but I found an alternative that fits me better.</p>
<h4>NetBeans:</h4>
<p><a href="http://netbeans.org/community/releases/68">Netbeans 6.8 (currently in beta)</a> is like Komodo a stable IDE with smaller memory footprint. It fits my wish-list and I can adapt quite easily to the shortcuts and natural for me. It&#8217;s a full featured IDE with all the bells and whistles. Room for improvement would be: More VCS plugins (Git), support for the Zend Debugger, scriptable (regexp) like syntax highlighting support, to be able to add custom highlighting.</p>
<h3>NetBeans Tips:</h3>
<h4>Font rendering in NetBeans on OSX:</h4>
<p>I love the anti-aliasing done by TextMate to my coding fonts.<br />
If you want to achieve the same effect in NetBeans, you need to add 2 parameters to the application startup-file.</p>
<ol>
<li> Open the finder and go to the <em>NetBean.app</em> file.</li>
<li> Press the right mouse-button (or <em>ctrl-click</em>) and select the option &#8220;<em>Show Package Contents</em>&#8220;.</li>
<li> In the new opened finder window, go to the following location: &#8220;<em>Contents/Resources/NetBeans/etc/</em>&#8220;</li>
<li> Edit the file: &#8220;<em>netbeans.conf</em>&#8220;</li>
<li> add the following to the end of the line starting with: &#8220;<em>netbeans_default_options=</em>&#8221; <strong>-J-Dsun.java2d.noddraw=true -J-Dapple.awt.graphics.UseQuartz=true</strong></li>
<li> save the file and start NetBeans.</li>
</ol>
<p>The font will be like you used to see in TextMate.</p>
<h4>Preventing Java crashes on OSX 10.6:</h4>
<p><strong>Update:</strong> I&#8217;ve updated to the final 6.8 release now and it runs fine on Java 6, so this workaround is probably not needed&#8230;.</p>
<p>If you are working on OSX Snow Leopard (10.6) and NetBeans crashes randomly, it&#8217;s worth a try to downgrade your Java from 6 to 5. This probably greatly improves stability for NetBeans and other Java applications running on OSX. To downgrade, I followed the steps outlined on the <a href="http://wiki.oneswarm.org/index.php/OS_X_10.6_Snow_Leopard">oneswarm wiki</a> and put them up here too.</p>
<p>Get the java 5 that was included in 10.5 &#8220;leopard&#8221; and unpack</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>
curl <span style="color: #660033;">-o</span> java.1.5.0-leopard.tar.gz http:<span style="color: #000000; font-weight: bold;">//</span>www.cs.washington.edu<span style="color: #000000; font-weight: bold;">/</span>homes<span style="color: #000000; font-weight: bold;">/</span>isdal<span style="color: #000000; font-weight: bold;">/</span>snow_leopard_workaround<span style="color: #000000; font-weight: bold;">/</span>java.1.5.0-leopard.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvzf</span> java.1.5.0-leopard.tar.gz</pre></div></div>

<p>Move it to your System java folder (password needed)</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> 1.5.0 <span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Frameworks<span style="color: #000000; font-weight: bold;">/</span>JavaVM.framework<span style="color: #000000; font-weight: bold;">/</span>Versions<span style="color: #000000; font-weight: bold;">/</span>1.5.0-leopard</pre></div></div>

<p>Tell OS X that java 5 actually is java 5</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Frameworks<span style="color: #000000; font-weight: bold;">/</span>JavaVM.framework<span style="color: #000000; font-weight: bold;">/</span>Versions<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> 1.5.0
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> 1.5.0-leopard 1.5.0
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000;">1.5</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> 1.5.0 <span style="color: #000000;">1.5</span></pre></div></div>

<p>Open Java Preferences</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">open <span style="color: #ff0000;">&quot;/Applications/Utilities/Java Preferences.app&quot;</span></pre></div></div>

<p>Change the properties to use Java 5 32-bit by default:<br />
<img class="alignnone" title="Set Java preferences" src="http://dlmax.org/wp-content/uploads/2009/11/java_snow_leopard.png" alt="" width="744" height="754" /></p>
<p>Start NetBeans and you&#8217;re done !</p>

	Tags: <a href="http://dlmax.org/tag/apple/" title="apple" rel="tag">apple</a>, <a href="http://dlmax.org/tag/development/" title="development" rel="tag">development</a>, <a href="http://dlmax.org/tag/ide/" title="ide" rel="tag">ide</a>, <a href="http://dlmax.org/tag/netbeans/" title="netbeans" rel="tag">netbeans</a>, <a href="http://dlmax.org/tag/osx/" title="osx" rel="tag">osx</a>, <a href="http://dlmax.org/tag/personal/" title="personal" rel="tag">personal</a>, <a href="http://dlmax.org/tag/php/" title="php" rel="tag">php</a>, <a href="http://dlmax.org/tag/work/" title="work" rel="tag">work</a><br />
]]></content:encoded>
			<wfw:commentRss>http://dlmax.org/2009/11/25/developing-in-php-with-netbeans/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Installing xDebug 2.0.4 or 2.1 on OSX</title>
		<link>http://dlmax.org/2009/01/13/installing-xdebug-204-or-21-on-osx/</link>
		<comments>http://dlmax.org/2009/01/13/installing-xdebug-204-or-21-on-osx/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 23:49:05 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[xdebug]]></category>

		<guid isPermaLink="false">http://dlmax.org/?p=190</guid>
		<description><![CDATA[In my previous post we installed the latest apache and php from source and now I&#8217;d like to install xDebug to it. As stated in the comments on the previous post, I like living on the edge, so I build it myself, instead of using packages like MAMP or XAMMP or using binaries.
With that out [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://dlmax.org/2008/12/29/installing-php-on-osx-leopard">previous post</a> we installed the latest apache and php from source and now I&#8217;d like to install <a href="http://xdebug.org">xDebug</a> to it. As stated in the comments on the previous post, I like living on the edge, so I build it myself, instead of using packages like MAMP or XAMMP or using binaries.<br />
With that out of the way we can prepare our system for the addition of PHP modules. </p>
<p>Because we didn&#8217;t need these commands for normal operation, phpize and php-config were still the standard Apple ones.<br />
We now need these commands, so we&#8217;ll make sure,just in case, the latest ones are used; open up your terminal and execute the next lines:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>phpize <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>phpize-leopard
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>phpize <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>phpize
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php-config <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php-config-leopard
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php-config <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php-config</pre></div></div>

<p>Create a folder to contain the sources for xDebug. It&#8217;s fine to use a filder in your userdir, so we&#8217;ll be using the &#8217;source&#8217; folder in your homedirectory(if you want you can choose another folder).</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">source</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">source</span></pre></div></div>

<p>Now you can go along two paths:</p>
<ol>
<li>
Download the sources for the <strong>stable release(2.0.4)</strong> of the xDebug package and extract it to a folder(a folder source/xdebug in your homedirectory is fine). Enter the next commands to download and extract the source:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">curl <span style="color: #660033;">-C</span> - <span style="color: #660033;">-O</span> http:<span style="color: #000000; font-weight: bold;">//</span>xdebug.org<span style="color: #000000; font-weight: bold;">/</span>files<span style="color: #000000; font-weight: bold;">/</span>xdebug-2.0.4.tgz
<span style="color: #c20cb9; font-weight: bold;">tar</span> xzf xdebug-2.0.4.tgz
<span style="color: #7a0874; font-weight: bold;">cd</span> xdebug-2.0.4</pre></div></div>

</li>
<li>
Get the <strong>latest version(2.1 unstable)</strong> by downloading from CVS. The advantage is you can use several newer features (like errors that contain a link to the file and linenumber, opening in your IDE or editor of choice). Execute the following commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">source</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">source</span>
<span style="color: #c20cb9; font-weight: bold;">cvs</span> <span style="color: #660033;">-d</span> :pserver:srmread<span style="color: #000000; font-weight: bold;">@</span>cvs.xdebug.org:<span style="color: #000000; font-weight: bold;">/</span>repository <span style="color: #c20cb9; font-weight: bold;">login</span></pre></div></div>

<p>Then enter the password <strong>srmread</strong> and issue the next commands;</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cvs</span> <span style="color: #660033;">-d</span> :pserver:srmread<span style="color: #000000; font-weight: bold;">@</span>cvs.xdebug.org:<span style="color: #000000; font-weight: bold;">/</span>repository <span style="color: #c20cb9; font-weight: bold;">co</span> xdebug
<span style="color: #7a0874; font-weight: bold;">cd</span> xdebug</pre></div></div>

</li>
</ol>
<p>Now we have the sources in the source/xdebug folder in our homedirectory(make sure you are in the folder containing the config.m4 file).<br />
Prepare this package for the php version at hand by using the next command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">phpize</pre></div></div>

<p>Then we need to set some parameters to ensure proper compiling on the mac(this should work on all flavors; Intel and PPC based Macs):</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">MACOSX_DEPLOYMENT_TARGET</span>=<span style="color: #000000;">10.5</span> <span style="color: #007800;">CFLAGS</span>=<span style="color: #ff0000;">&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp&quot;</span> 
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CCFLAGS</span>=<span style="color: #ff0000;">&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe&quot;</span> 
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CXXFLAGS</span>=<span style="color: #ff0000;">&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe&quot;</span> 
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LDFLAGS</span>=<span style="color: #ff0000;">&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load&quot;</span></pre></div></div>

<p>Then we can compile and build the module:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--enable-xdebug</span>
<span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

<p>We&#8217;ll copy the module to the PHP modules folder, because that&#8217;s were it&#8217;s going to be used <img src='http://dlmax.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> modules<span style="color: #000000; font-weight: bold;">/</span>xdebug.so <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>modules</pre></div></div>

<p>Add the following to the end of the <strong>/opt/local/php/lib/php.ini</strong> file:</p>

<div class="wp_syntax"><div class="code"><pre class="ini ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>xdebug<span style="">&#93;</span></span>
<span style="color: #000099;">zend_extension</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">/opt/local/php/modules/xdebug.so</span></pre></div></div>

<p>Now restart your webserver to incorporate the changes to the php.ini file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> apachectl restart</pre></div></div>

<p>If you go to the testpage we created in the last blogpost(or if you create a new php file containing <strong>phpinfo();</strong> in your webroot), it should then show the following bar at the top:<br />
for version 2.0.4:<br />
<img src="http://farm4.static.flickr.com/3111/3179292083_bc6f17440e.jpg" alt="phpinfo() banner for xDebug 2.0.4" width="500" height="69" border="0" /><br />
and for 2.1 dev:<br />
<img src="http://farm4.static.flickr.com/3514/3180128486_426f8022b5.jpg" alt="phpinfo() banner for xDebug 2.1-dev" width="500" height="68" border="0" /><br />
And almost at the bottom of the page there should be all xDebug parameters.</p>
<p>Now every time we use a <strong>var_dump()</strong> it looks like this:<br />
<a href="http://farm4.static.flickr.com/3421/3192826984_4e47a0dbd4.jpg" class="tt-flickr tt-flickr tt-flickr-Thumbnail" title="xDebug var_dump()" rel="lightbox[190]"><img src="http://farm4.static.flickr.com/3421/3192826984_4e47a0dbd4_t.jpg" alt="xDebug var_dump()" width="77" height="100" border="0" /></a><br />
And if an error occurs, it shows like this:<br />
<a href="http://farm4.static.flickr.com/3343/3192826856_6a28211524_o.png" class="tt-flickr tt-flickr tt-flickr-Thumbnail" title="xDebug PHP Error" rel="lightbox[190]"><img src="http://farm4.static.flickr.com/3343/3192826856_3bd760e7e9_t.jpg" alt="xDebug PHP Error" width="100" height="16" border="0" /></a> </p>
<p>At this time we have more advanced error reporting and we have better looking var_dumps() and we can connect a debugger to xDebug and can use xDebug for application profiling.</p>
<p>More on how to do this on MacOSX in the next post.</p>

	Tags: <a href="http://dlmax.org/tag/apache/" title="apache" rel="tag">apache</a>, <a href="http://dlmax.org/tag/osx/" title="osx" rel="tag">osx</a>, <a href="http://dlmax.org/tag/php/" title="php" rel="tag">php</a>, <a href="http://dlmax.org/tag/work/" title="work" rel="tag">work</a>, <a href="http://dlmax.org/tag/xdebug/" title="xdebug" rel="tag">xdebug</a><br />
]]></content:encoded>
			<wfw:commentRss>http://dlmax.org/2009/01/13/installing-xdebug-204-or-21-on-osx/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Installing PHP 5.2.8 on OSX Leopard 10.5.6</title>
		<link>http://dlmax.org/2008/12/29/installing-php-on-osx-leopard/</link>
		<comments>http://dlmax.org/2008/12/29/installing-php-on-osx-leopard/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 22:02:03 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://dlmax.org/?p=155</guid>
		<description><![CDATA[Because I travel a lot by train, it&#8217;s easy to have a local development environment with me. Because OSX Leopard contains Apache2 and PHP 5.2.6, I installed MySQL, ZF, PEAR, setup the vhost conf for apache and added the path to the ZF and PEAR libraries to /etc/php.ini. This seemed to work fine for a [...]]]></description>
			<content:encoded><![CDATA[<p>Because I travel a lot by train, it&#8217;s easy to have a local development environment with me. Because OSX Leopard contains Apache2 and PHP 5.2.6, I installed MySQL, ZF, PEAR, setup the vhost conf for apache and added the path to the ZF and PEAR libraries to /etc/php.ini. This seemed to work fine for a day or two, but after that I needed to use the PDO_MySQL library. This didn&#8217;t really work&#8230; The fact is that PDO_SQLite and PDO_SQLite2 are compiled along the installed PHP library, but PDO_MySQL isn&#8217;t&#8230; Big FAIL!.</p>
<p>So, we&#8217;ll have to setup a new PHP/Apache2 combo&#8230;..<span id="more-155"></span><br />
Okay let&#8217;s start:</p>
<h2>1. Install the Apple Developer tools</h2>
<p>If you haven&#8217;t done it already, install the Developer Tools(XCode 3) from the OSX DVD</p>
<h2>2. Install and update MacPorts</h2>
<p>If you haven&#8217;t installed MacPorts on your system, do so by downloading it from the <a href="http://www.macports.org">MacPorts website</a> and running the installer.<br />
Now open a terminal window and update MacPorts:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">sudo</span> port selfupdate
 <span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">sync</span></pre></div></div>

<h2>3. Install apache2</h2>
<p>Create the following directory and symlink for the correct use of MySQL (the install searches there for libraries):</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Install Apache2:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> apache2</pre></div></div>

<p>Let the apache2 process be autostarted by the system:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">sudo</span> launchctl load <span style="color: #660033;">-w</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons<span style="color: #000000; font-weight: bold;">/</span>org.macports.apache2.plist</pre></div></div>

<p>Move the old Apache stuff out of the way:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>apachectl <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>apachectl-leopard
 <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>apachectl <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>apachectl</pre></div></div>

<p>Copy the sample conf file and make it the default</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>httpd.conf.sample <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>httpd.conf</pre></div></div>

<p>Now you can modify your apache settings to your liking, but remember to use only the ones in the <strong>/opt/local/apache2/conf</strong> directory; the old configs(<em>/etc/apache2/conf</em>) are not used anymore.</p>
<h2>4. Install the additional stuff needed</h2>
<p>Then make sure we have everything installed we want in there; I want: GD libraries, iconv, PDO_MySQL, curl</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> jpeg
<span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> libpng
<span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> freetype
<span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> libmcrypt
<span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> tidy
<span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> libiconv</pre></div></div>

<p>Rename the default iconv.h because it generates errors while compiling PHP</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>iconv.h <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>iconv.h.leo_orig
 <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>iconv.h <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>iconv.h</pre></div></div>

<h2>5. Download, configure and install PHP</h2>
<p>Download the php5.2.8.tar.gz file from the <a href="http://www.php.net/downloads.php">PHP website</a>.<br />
go to your download directory and run</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> xvzf php-5.2.8.tar.gz</pre></div></div>

<p>Then move this folder to the /opt/local/php-5.2.8 folder</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">  <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> php-5.2.8 <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Then create a symlink that you can compile against:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>php-5.2.8 <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>php</pre></div></div>

<p>Go into the newly created &#8216;folder&#8217;:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Now configure PHP:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"> <span style="color: #ff0000;">'./configure'</span> \
 <span style="color: #ff0000;">'--prefix=/opt/local/php'</span> \
 <span style="color: #ff0000;">'--with-apxs2=/opt/local/apache2/bin/apxs'</span> \
 <span style="color: #ff0000;">'--with-xsl=/usr'</span> \
 <span style="color: #ff0000;">'--with-tidy=/opt/local'</span> \
 <span style="color: #ff0000;">'--with-ldap=/usr'</span> \
 <span style="color: #ff0000;">'--with-kerberos=/usr'</span> \
 <span style="color: #ff0000;">'--enable-mbregex'</span> \
 <span style="color: #ff0000;">'--enable-ftp'</span> \
 <span style="color: #ff0000;">'--with-iodbc=/usr'</span> \
 <span style="color: #ff0000;">'--with-curl=/usr'</span> \
 <span style="color: #ff0000;">'--enable-mbstring'</span> \
 <span style="color: #ff0000;">'--with-gd'</span> \
 <span style="color: #ff0000;">'--with-jpeg-dir=/opt/local'</span> \
 <span style="color: #ff0000;">'--with-png-dir=/opt/local'</span> \
 <span style="color: #ff0000;">'--with-zlib-dir'</span> \
 <span style="color: #ff0000;">'--enable-sockets'</span> \
 <span style="color: #ff0000;">'--enable-exif'</span> \
 <span style="color: #ff0000;">'--with-mcrypt=/opt/local'</span> \
 <span style="color: #ff0000;">'--enable-soap'</span> \
 <span style="color: #ff0000;">'--with-mysql=/usr/local/mysql'</span> \
 <span style="color: #ff0000;">'--with-mysqli=/usr/local/mysql/bin/mysql_config'</span> \
 <span style="color: #ff0000;">'--with-pdo-mysql=/usr/local/mysql/bin/mysql_config'</span> \
 <span style="color: #ff0000;">'--with-mysql-sock=/tmp/mysql.sock'</span> \
 <span style="color: #ff0000;">'--with-freetype-dir=/opt/local'</span> \
 <span style="color: #ff0000;">'--with-openssl=/opt/local'</span> \
 <span style="color: #ff0000;">'--with-iconv=/usr'</span> \
 <span style="color: #ff0000;">'--with-libxml-dir=/usr'</span> \
 <span style="color: #ff0000;">'--with-xmlrpc'</span> \
 <span style="color: #ff0000;">'--enable-cli'</span></pre></div></div>

<p>Then make and install php:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span>
 <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>And rename the old PHP and create a symlink to the new binary:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php-leopard
 <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php</pre></div></div>

<p>copy the new php.ini file and edit it to your liking:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> php.ini-dist lib<span style="color: #000000; font-weight: bold;">/</span>php.ini</pre></div></div>

<p><strong>Note:</strong>  The new php.ini file in use is the one located at: <strong>/opt/local/php/lib/php.ini</strong></p>
<h2>6. Restart the webserver</h2>
<p>Up until now the old webserver was running. Shut it down and then start the new apache2:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">sudo</span> apachectl-leopard stop
 <span style="color: #c20cb9; font-weight: bold;">sudo</span> apachectl start</pre></div></div>

<p>If all went well, Apache is running and PHP scripts get executed. Please check the installed features by calling a page with the following code on it, to  ensure everything is installed.</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
 <span style="color: #990000;">phpinfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>In the next post we will add xDebug to the stack and later on the debugging environment is setup for different IDEs.<br />
<a href="http://dlmax.org/2009/01/13/installing-xdebug-204-or-21-on-osx/">Part2: Installing xDebug on OSX</a></p>

	Tags: <a href="http://dlmax.org/tag/apache/" title="apache" rel="tag">apache</a>, <a href="http://dlmax.org/tag/hack/" title="hack" rel="tag">hack</a>, <a href="http://dlmax.org/tag/osx/" title="osx" rel="tag">osx</a>, <a href="http://dlmax.org/tag/php/" title="php" rel="tag">php</a><br />
]]></content:encoded>
			<wfw:commentRss>http://dlmax.org/2008/12/29/installing-php-on-osx-leopard/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
	</channel>
</rss>
