<?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>Bisna Blog</title>
	<atom:link href="http://blog.bisna.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bisna.com</link>
	<description>Blog of Guilherme Blanco</description>
	<lastBuildDate>Sun, 14 Aug 2011 02:14:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Standard way for local configuration file in Zend Framework</title>
		<link>http://blog.bisna.com/2011/08/standard-way-for-local-configuration-file-in-zend-framework/</link>
		<comments>http://blog.bisna.com/2011/08/standard-way-for-local-configuration-file-in-zend-framework/#comments</comments>
		<pubDate>Sun, 14 Aug 2011 02:13:56 +0000</pubDate>
		<dc:creator>guilhermeblanco</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.bisna.com/?p=33</guid>
		<description><![CDATA[I&#8217;ve read people have talked about local configuration files in Zend Framework. As of Zend Framework 1.10, multiple configuration files is supported by Zend_Application. Here is the right (standardized) approach: $application = new Zend_Application&#40; APPLICATION_ENV, array&#40; 'config' =&#38;gt; array&#40; APPLICATION_PATH &#8230; <a href="http://blog.bisna.com/2011/08/standard-way-for-local-configuration-file-in-zend-framework/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve <a href="http://zendtutorials.com/tutorial/using-local-configuration-files-in-zend-framework/">read</a> people have talked about local configuration files in Zend Framework.</p>
<p>As of Zend Framework 1.10, multiple configuration files is supported by Zend_Application. Here is the right (standardized) approach:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="re0">$application</span> <span class="sy0">=</span> <span class="kw2">new</span> Zend_Application<span class="br0">&#40;</span>
    APPLICATION_ENV<span class="sy0">,</span>
    <span class="kw3">array</span><span class="br0">&#40;</span>
        <span class="st_h">'config'</span> <span class="sy0">=&amp;</span>gt<span class="sy0">;</span> <span class="kw3">array</span><span class="br0">&#40;</span>
            APPLICATION_PATH <span class="sy0">.</span> <span class="st_h">'/configs/application.ini'</span><span class="sy0">,</span>
            APPLICATION_PATH <span class="sy0">.</span> <span class="st_h">'/configs/local.ini'</span>
        <span class="br0">&#41;</span>
    <span class="br0">&#41;</span>
<span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div></div></div></div></div></div>


<p>I hope this small tip becomes spread instead of alternative approaches, that most of the times overload your Zend application.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bisna.com/2011/08/standard-way-for-local-configuration-file-in-zend-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing Mysql sock issue when using PHP on Snow Leopard</title>
		<link>http://blog.bisna.com/2011/04/fixing-mysql-sock-issue-when-using-php-on-snow-leopard/</link>
		<comments>http://blog.bisna.com/2011/04/fixing-mysql-sock-issue-when-using-php-on-snow-leopard/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 15:24:38 +0000</pubDate>
		<dc:creator>guilhermeblanco</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.bisna.com/?p=26</guid>
		<description><![CDATA[If you followed my tutorial pages about installing Apache + PHP + missing extensions and installing PEAR previously, maybe you are interested to look at this fix. Installing MySQL is easy. Just go to MySQL Download page and grab the &#8230; <a href="http://blog.bisna.com/2011/04/fixing-mysql-sock-issue-when-using-php-on-snow-leopard/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you followed my tutorial pages about <a title="Getting Snow Leopard built-in MAMP to work smoothly" href="http://blog.bisna.com/2011/04/getting-snow-leopard-builtin-mamp-to-work-smoothly/">installing Apache + PHP + missing extensions</a> and <a title="Installing PEAR on built-in PHP of Snow Leopard" href="http://blog.bisna.com/2011/04/installing-pear-on-builtin-php-of-snow-leopard/">installing PEAR</a> previously, maybe you are interested to look at this fix.</p>
<p>Installing MySQL is easy. Just go to <a title="MySQL Download page" href="http://dev.mysql.com/downloads/mysql/" target="_blank">MySQL Download page</a> and grab the x86_64 DMG file.<br />
Follow the installation instructions and do not forget to also install StartupItem.</p>
<p>As soon as you attempt to connect to MySQL, this error would popup for you:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1">Warning: mysql_connect<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#91;</span>function.mysql-connect<span class="br0">&#93;</span>: <span class="br0">&#91;</span><span class="nu0">2002</span><span class="br0">&#93;</span> No such <span class="kw2">file</span>  or directory <span class="br0">&#40;</span>trying to connect via unix:<span class="sy0">///</span>var<span class="sy0">/</span>mysql<span class="sy0">/</span>mysql.sock<span class="br0">&#41;</span> <span class="kw1">in</span> ...</pre></div></div></div></div></div></div></div>


<p>To fix that, the only necessary change is actually to create a symbolic link to the same location PHP is looking at (I would recommend to update php.ini config to point to the right file).</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1">$ <span class="kw2">sudo</span> <span class="kw2">mkdir</span> <span class="sy0">/</span>var<span class="sy0">/</span>mysql
$ <span class="kw2">sudo</span> <span class="kw2">ln</span> <span class="re5">-s</span> <span class="sy0">/</span>tmp<span class="sy0">/</span>mysql.sock <span class="sy0">/</span>var<span class="sy0">/</span>mysql<span class="sy0">/</span>mysql.sock</pre></div></div></div></div></div></div></div>


<p>Restart your Apache and live happy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bisna.com/2011/04/fixing-mysql-sock-issue-when-using-php-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing PEAR on built-in PHP of Snow Leopard</title>
		<link>http://blog.bisna.com/2011/04/installing-pear-on-builtin-php-of-snow-leopard/</link>
		<comments>http://blog.bisna.com/2011/04/installing-pear-on-builtin-php-of-snow-leopard/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 02:37:47 +0000</pubDate>
		<dc:creator>guilhermeblanco</dc:creator>
				<category><![CDATA[pear]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.bisna.com/?p=15</guid>
		<description><![CDATA[If you followed my last blog post, now you have your PHP environment with missing extensions compiled and loaded. But we still lack of PEAR support. This post has the intention to explain how to install PEAR on your default &#8230; <a href="http://blog.bisna.com/2011/04/installing-pear-on-builtin-php-of-snow-leopard/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you followed my last <a title="Getting Snow Leopard built-in MAMP to work smoothly" href="http://blog.bisna.com/2011/04/getting-snow-leopard-builtin-mamp-to-work-smoothly/">blog post</a>, now you have your PHP environment with missing extensions compiled and loaded. But we still lack of PEAR support.</p>
<p>This post has the intention to explain how to install PEAR on your default Snow Leopard PHP binary.</p>
<p>First open your Terminal and type these commands:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1">$ <span class="kw3">cd</span> <span class="sy0">/</span>usr<span class="sy0">/</span><span class="kw3">local</span>
$ curl http:<span class="sy0">//</span>pear.php.net<span class="sy0">/</span>go-pear.phar <span class="sy0">&amp;</span>gt; go-pear.phar
$ php go-pear.phar</pre></div></div></div></div></div></div></div>


<p>It will open a configuration panel. Type each number and define the correct directory. Here is my final configuration:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1">Below is a suggested <span class="kw2">file</span> layout <span class="kw1">for</span> your new PEAR installation.  To
change individual locations, <span class="kw3">type</span> the number <span class="kw1">in</span> front of the
directory.  Type <span class="st_h">'all'</span> to change all of them or simply press Enter to
accept these locations.
&nbsp;
<span class="nu0">1</span>. Installation base <span class="br0">&#40;</span><span class="re1">$prefix</span><span class="br0">&#41;</span>                   : <span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>pear
<span class="nu0">2</span>. Temporary directory <span class="kw1">for</span> processing            : <span class="sy0">/</span>tmp<span class="sy0">/</span>pear<span class="sy0">/</span><span class="kw2">install</span>
<span class="nu0">3</span>. Temporary directory <span class="kw1">for</span> downloads             : <span class="sy0">/</span>tmp<span class="sy0">/</span>pear<span class="sy0">/</span><span class="kw2">install</span>
<span class="nu0">4</span>. Binaries directory                            : <span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>bin
<span class="nu0">5</span>. PHP code directory <span class="br0">&#40;</span><span class="re1">$php_dir</span><span class="br0">&#41;</span>                 : <span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>pear<span class="sy0">/</span>share<span class="sy0">/</span>pear
<span class="nu0">6</span>. Documentation directory                       : <span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>pear<span class="sy0">/</span>docs
<span class="nu0">7</span>. Data directory                                : <span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>pear<span class="sy0">/</span>data
<span class="nu0">8</span>. User-modifiable configuration files directory : <span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>pear<span class="sy0">/</span>cfg
<span class="nu0">9</span>. Public Web Files directory                    : <span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>pear<span class="sy0">/</span>www
<span class="nu0">10</span>. Tests directory                               : <span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>pear<span class="sy0">/</span>tests
<span class="nu0">11</span>. Name of configuration <span class="kw2">file</span>                    : <span class="sy0">/</span>Users<span class="sy0">/</span>gblanco<span class="sy0">/</span>.pearrc</pre></div></div></div></div></div></div></div>


<p>Install PEAR and it would likely trigger that it could not update the php.ini file. We will fix that manually now.</p>
<p>Open <code>/private/etc/php.ini</code> and locate the include_path line. If it is not commented, update it, otherwise, expose this variable through this line:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="ini"><pre class="de1"><span class="re1">include_path</span><span class="sy0">=</span><span class="st0">&quot;.:/usr/local/pear/share/pear&quot;</span></pre></div></div></div></div></div></div></div>


<p>That&#8217;s it! Now you have PEAR configured with your built-in PHP. You&#8217;re now able to install PEAR packages without any troubles.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bisna.com/2011/04/installing-pear-on-builtin-php-of-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Getting Snow Leopard built-in MAMP to work smoothly</title>
		<link>http://blog.bisna.com/2011/04/getting-snow-leopard-builtin-mamp-to-work-smoothly/</link>
		<comments>http://blog.bisna.com/2011/04/getting-snow-leopard-builtin-mamp-to-work-smoothly/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 02:07:28 +0000</pubDate>
		<dc:creator>guilhermeblanco</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[apc]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[imagemagick]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[snow leopard]]></category>
		<category><![CDATA[xdebug]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://blog.bisna.com/?p=7</guid>
		<description><![CDATA[Considering you are here, I can assume you are a desperate folk looking for a possible solution to make built-in MAMP work perfectly using the default packages that comes with clean Snow Leopard installation. Trust me, I was feeling like &#8230; <a href="http://blog.bisna.com/2011/04/getting-snow-leopard-builtin-mamp-to-work-smoothly/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Considering you are here, I can assume you are a desperate folk looking for a possible solution to make built-in MAMP work perfectly using the default packages that comes with clean Snow Leopard installation. Trust me, I was feeling like you are now a few hours before I start this post.</p>
<p>Here you&#8217;ll see how to enable Apache2, turn PHP 5.3 available on server and also install missing PECL extensions of PHP, such as <a title="Imagick" href="http://pecl.php.net/package/imagick" target="_blank">Imagick</a> (<a title="ImageMagick" href="http://www.imagemagick.org" target="_blank">ImageMagick</a>), <a title="Xdebug" href="http://pecl.php.net/package/xdebug" target="_blank">Xdebug</a>, <a title="APC" href="http://pecl.php.net/package/APC" target="_blank">APC</a> and <a title="Memcache" href="http://pecl.php.net/package/memcache" target="_blank">Memcache</a>.</p>
<p>Before we start I would assume you have <a title="Xcode" href="http://developer.apple.com/xcode/" target="_blank">Xcode</a> and <a title="Homebrew" href="http://mxcl.github.com/homebrew/" target="_blank">Homebrew</a> installed.<br />
Xcode 4 is paid, but you can install 3rd version by using the DVD that came with your Mac. It&#8217;s <em><strong>free</strong></em>! =)</p>
<p><strong>Enabling Web Sharing (Web Server)</strong></p>
<p>This is the first step to be done, which is turn Apache2 ON to make your machine responds to HTTP requests. To do that, open your System Preferences &gt; Sharing. Then, turn on Web Sharing:</p>
<p><a href="http://blog.bisna.com/wp-content/uploads/2011/04/WebSharing.png"><img class="aligncenter size-medium wp-image-8" title="WebSharing" src="http://blog.bisna.com/wp-content/uploads/2011/04/WebSharing-300x246.png" alt="" width="300" height="246" /></a></p>
<p>That&#8217;s it. You already have Apache2 running on your system. Now let&#8217;s enable PHP.</p>
<p><strong>Enabling PHP on Web Server</strong></p>
<p>To enable PHP in Apache, you have to open <code>/private/etc/apache2/httpd.conf</code> file with root privileges. Locate the line:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="apache"><pre class="de1"><span class="co1">#LoadModule php5_module        libexec/apache2/libphp5.so</span></pre></div></div></div></div></div></div></div>


<p>Remove the #.<br />
Now, locate the line:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="apache"><pre class="de1"><span class="kw1">DirectoryIndex</span> index.html</pre></div></div></div></div></div></div></div>


<p>Edit it to be:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="apache"><pre class="de1"><span class="kw1">DirectoryIndex</span> index.php index.html</pre></div></div></div></div></div></div></div>


<p>Now, save and exit.<br />
Go to System Preferences &gt; Sharing again and turn Web Sharing OFF then ON.</p>
<p><strong>Testing Apache2 + PHP integration</strong></p>
<p>You can use Terminal for this one. We are going to create a phpinfo file, which displays all PHP configuration that is exposed to user land. In Terminal:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1">$ <span class="kw3">cd</span> ~<span class="sy0">/</span>Sites
$ <span class="kw2">vim</span> info.php</pre></div></div></div></div></div></div></div>


<p>Now press I (enable Insert mode in VIm) and type:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="kw2">&lt;?php</span> <span class="kw3">phpinfo</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="sy1">?&gt;</span></pre></div></div></div></div></div></div></div>


<p>Now press <code>Esc</code>, then <code>:wq</code> &lt;Enter&gt;<br />
<code>Esc</code> leaves Insert mode of VIm and enter in File manipulation mode. <code>W</code> means write and <code>Q</code> means quit.</p>
<p>Access your page, it should be something similar to <code>http://localhost/~&lt;username&gt;/info.php</code><br />
You should see a page similar to this one:</p>
<p><a href="http://blog.bisna.com/wp-content/uploads/2011/04/Screen-shot-2011-04-11-at-10.16.18-PM.png"><img class="aligncenter size-medium wp-image-10" title="Screen shot 2011-04-11 at 10.16.18 PM" src="http://blog.bisna.com/wp-content/uploads/2011/04/Screen-shot-2011-04-11-at-10.16.18-PM-300x150.png" alt="" width="300" height="150" /></a>If you scroll down, you will see at Date extension a big warning telling you haven&#8217;t chosen a locale of your server. We are going to fix this now. On Terminal, type this:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1"><span class="co4">$ </span><span class="kw2">sudo</span> <span class="kw2">cp</span> <span class="sy0">/</span>private<span class="sy0">/</span>etc<span class="sy0">/</span>php.ini.default <span class="sy0">/</span>private<span class="sy0">/</span>etc<span class="sy0">/</span>php.ini</pre></div></div></div></div></div></div></div>


<p>Now open this file for edit. Locate this line:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="ini"><pre class="de1"><span class="co0">;date.timezone=</span></pre></div></div></div></div></div></div></div>


<p>Remove the <code>;</code> and place whatever timezone you are at. Here is the <a title="list of available timezones" href="http://php.net/manual/en/timezones.php" target="_blank">list of available timezones</a>. In my case, I&#8217;m in <strong>America/Sao_Paulo</strong>.</p>
<p>Save the file and reload the server (go to System Preferences &gt; Sharing, then disable and enable Web Sharing. Next time I&#8217;ll now explain again. =P). Now refresh the info page and the warning disappeared.</p>
<p>It is now time to install missing extensions on PHP.</p>
<p><strong>Compiling APC on PHP</strong></p>
<p>If you are familiar with PHP from other environments, you may think it is simply do a pecl install. The problem is that Snow Leopard doesn&#8217;t come with pecl or pear available by default. While pear is possible to be installed manually, pecl isn&#8217;t. So we need to make the everything the hard way.</p>
<p>Download the latest stable APC package available at: <a title="http://pecl.php.net/package/APC" href="http://pecl.php.net/package/APC" target="_blank">http://pecl.php.net/package/APC</a><br />
Decompress the folder.</p>
<p>Install required packages for APC. That&#8217;s where Homebrew comes to rescue us.<br />
Go to your Terminal and type:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1"><span class="co4">$ </span><span class="kw2">sudo</span> brew <span class="kw2">install</span> pcre</pre></div></div></div></div></div></div></div>


<p>It should install PCRE dependency. As soon as it finishes, we are allowed to continue to the next step.</p>
<p>Go inside of decompressed folder and on Terminal run these commands:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1">$ phpize
$ <span class="re2">CFLAGS</span>=<span class="st_h">'-arch x86_64'</span> .<span class="sy0">/</span>configure
$ <span class="kw2">make</span>
$ <span class="kw2">sudo</span> <span class="kw2">make</span> <span class="kw2">install</span></pre></div></div></div></div></div></div></div>


<p>Please remember these 4 commands. We will use them to compile other extensions.</p>
<p>Now we need to enable the APC on PHP. Open <code>/private/etc/php.ini</code> in edit mode.<br />
Locate a similar line and add this:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="ini"><pre class="de1"><span class="re1">extension</span><span class="sy0">=</span><span class="re2">/usr/lib/php/extensions/no-debug-non-zts-20090626/apc.so</span></pre></div></div></div></div></div></div></div>


<p>Save file and reload your server. Info should not display that APC is correctly configured!</p>
<p><strong>Compiling Memcache on PHP</strong></p>
<p>We are going to make the same process that we did with APC.<br />
First download the latest stable package available at: <a title="http://pecl.php.net/package/memcache" href="http://pecl.php.net/package/memcache" target="_blank">http://pecl.php.net/package/memcache</a><br />
Here are the steps I&#8217;ve done on my personal machine:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1">$ <span class="kw2">mv</span> ~<span class="sy0">/</span>Downloads<span class="sy0">/</span>memcache-<span class="sy0">*</span> ~<span class="sy0">/</span>src
$ <span class="kw3">cd</span> ~<span class="sy0">/</span>src
$ <span class="kw2">tar</span> xvf memcache-<span class="sy0">*</span>
$ <span class="kw3">cd</span> memcache-<span class="sy0">*</span>
$ phpize
$ <span class="re2">CFLAGS</span>=<span class="st_h">'-arch x86_64'</span> .<span class="sy0">/</span>configure
$ <span class="kw2">make</span>
$ <span class="kw2">sudo</span> <span class="kw2">make</span> <span class="kw2">install</span></pre></div></div></div></div></div></div></div>


<p>Now I opened again the <code>/private/etc/php.ini</code> file, located the apc.so line and added on the next line:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="ini"><pre class="de1"><span class="re1">extension</span><span class="sy0">=</span><span class="re2">/usr/lib/php/extensions/no-debug-non-zts-20090626/memcache.so</span></pre></div></div></div></div></div></div></div>


<p>Restarting the web server, my info now displays the Memcache extension loaded on PHP!</p>
<p><strong>Compiling Xdebug on PHP</strong></p>
<p>I followed the same steps that I did with Memcache, grabbing the latest stable package available at: <a title="http://pecl.php.net/package/xdebug" href="http://pecl.php.net/package/xdebug" target="_blank">http://pecl.php.net/package/xdebug</a></p>
<p>Enabling it is a bit different. I opened the <code>/private/etc/php.ini</code> file and added at the end of it:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="ini"><pre class="de1"><span class="re0"><span class="br0">&#91;</span>xdebug<span class="br0">&#93;</span></span>
<span class="re1">zend_extension</span><span class="sy0">=</span><span class="re2">/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so</span>
xdebug.file_link_format<span class="sy0">=</span><span class="st0">&quot;txmt://open?url=file://%f&amp;amp;line=%1&quot;</span>
xdebug.remote_enable <span class="sy0">=</span><span class="re2"> On</span>
<span class="co0">;xdebug.remote_handler = 'dbgp'</span>
<span class="co0">;xdebug.remote_handler = 'gdb'</span>
<span class="co0">;xdebug.remote_mode = jit</span>
xdebug.remote_autostart <span class="sy0">=</span><span class="re2"> 1</span></pre></div></div></div></div></div></div></div>


<p>Reloaded my server and voilà! It worked!</p>
<p><strong>Compiling Imagick on PHP</strong></p>
<p>Imagick relies on ImageMagick in order to work. Again we ask help for Homebrew to save our lives.</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1"><span class="co4">$ </span><span class="kw2">sudo</span> brew <span class="kw2">install</span> imagemagick</pre></div></div></div></div></div></div></div>


<p>I will install a couple of dependencies, but at the end we&#8217;ll have ImageMagick working. Now we can get back to our tedious work of phpize, configure, make, make install&#8230;<br />
Grab the latest stable package available at: <a title="http://pecl.php.net/package/imagick" href="http://pecl.php.net/package/imagick" target="_blank">http://pecl.php.net/package/imagick</a><br />
Now, execute the commands:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1">$ <span class="kw2">mv</span> ~<span class="sy0">/</span>Downloads<span class="sy0">/</span>imagick-<span class="sy0">*</span> ~<span class="sy0">/</span>src
$ <span class="kw3">cd</span> ~<span class="sy0">/</span>src
$ <span class="kw2">tar</span> xvf imagick-<span class="sy0">*</span>
$ <span class="kw3">cd</span> imagick-<span class="sy0">*</span>
$ phpize
$ <span class="re2">CFLAGS</span>=<span class="st_h">'-arch x86_64'</span> .<span class="sy0">/</span>configure
$ <span class="kw2">make</span>
$ <span class="kw2">sudo</span> <span class="kw2">make</span> <span class="kw2">install</span></pre></div></div></div></div></div></div></div>


<p>Finally, open the <code>/private/etc/php.ini</code> file, located the memcache.so line and added on the next line:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="ini"><pre class="de1"><span class="re1">extension</span><span class="sy0">=</span><span class="re2">/usr/lib/php/extensions/no-debug-non-zts-20090626/imagick.so</span></pre></div></div></div></div></div></div></div>


<p>Reload your server and have fun! =)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bisna.com/2011/04/getting-snow-leopard-builtin-mamp-to-work-smoothly/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://blog.bisna.com/2011/02/hello-world/</link>
		<comments>http://blog.bisna.com/2011/02/hello-world/#comments</comments>
		<pubDate>Sun, 27 Feb 2011 05:42:19 +0000</pubDate>
		<dc:creator>guilhermeblanco</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.bisna.com/?p=1</guid>
		<description><![CDATA[Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!]]></description>
			<content:encoded><![CDATA[<p>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bisna.com/2011/02/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

