<?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>superfancy &#187; php</title>
	<atom:link href="http://superfancy.net/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://superfancy.net</link>
	<description>version .02: slowly getting there</description>
	<lastBuildDate>Tue, 10 Nov 2009 00:46:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Simple customization of Wordpress Sidebar Login Plugin</title>
		<link>http://superfancy.net/coding/simple-customization-wordpress-sidebar-login-plugin/</link>
		<comments>http://superfancy.net/coding/simple-customization-wordpress-sidebar-login-plugin/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 23:49:08 +0000</pubDate>
		<dc:creator>Stevie</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Codex]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Sidebar Login]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.steviebenge.com/?p=128</guid>
		<description><![CDATA[I came across this great Wordpress plugin yesterday called Sidebar Login. Like the name says, it lets you place a login form in your WordPress sidebar so you can bypass the typical WP login screen. I thought the plugin would be a nice addition to a site I&#8217;m finishing up at work. Here&#8217;s what it [...]]]></description>
			<content:encoded><![CDATA[<p>I came across this great <a href="http://wordpress.org">Wordpress</a> plugin yesterday called <a href="http://wordpress.org/extend/plugins/sidebar-login/">Sidebar Login</a>. Like the name says, it lets you place a login form in your WordPress sidebar so you can bypass the typical WP login screen. I thought the plugin would be a nice addition to a site I&#8217;m finishing up at work. Here&#8217;s what it looks like on my site:</p>
<p><img src="http://www.steviebenge.com/wp-content/uploads/2008/09/picture-1.png" alt="" title="Default Login Screen" width="269" height="263" class="alignnone size-full wp-image-129" /><br />
<span id="more-128"></span><br />
It pretty much works as advertised. Like most WP plugins it&#8217;s easy to install and activate. To bring it up in your sidebar, you use the nifty template tag:</p>

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

<p>Simple enough. Though it does have one quirk I&#8217;d like to point out. When you login with Sidebar Login, it has a pleasant &#8220;welcome&#8221; greeting, followed by your Username. Like so:</p>
<p><img src="http://www.steviebenge.com/wp-content/uploads/2008/09/picture-2.png" alt="" title="Greeting" width="266" height="149" class="alignnone size-full wp-image-130" /></p>
<p>Kinda silly, huh? I think a better behavior for this would be to to use your &#8220;Display Name&#8221; so it&#8217;s a bit more personalized. So instead of in my case displaying &#8220;Admin,&#8221; it&#8217;ll display &#8220;Stevie,&#8221; which I have setup in the WP Dashboard:</p>
<p><img src="http://www.steviebenge.com/wp-content/uploads/2008/09/picture-3.png" alt="" title="Display Name" width="370" height="58" class="alignnone size-full wp-image-131" /></p>
<p>All it takes is a little consultation with the WordPress Codex to produce this helpful document, <a href="http://codex.wordpress.org/Function_Reference/get_userdata">Function Reference/get userdata</a> to find the info we need. </p>
<p>In the code to the plugin, on or around Line 26 there you&#8217;ll find this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #000088;">$before_widget</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$before_title</span> <span style="color: #339933;">.</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Welcome &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span> <span style="color: #000088;">$user_info</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">user_login</span>  <span style="color: #339933;">.</span><span style="color: #000088;">$after_title</span><span style="color: #339933;">;</span></pre></div></div>

<p>What we need to do is change <code>$user_info->user_login</code> to use <code>$user_info->display_name</code>. Here is the complete revised line:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #000088;">$before_widget</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$before_title</span> <span style="color: #339933;">.</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Welcome &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span> <span style="color: #000088;">$user_info</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">display_name</span>  <span style="color: #339933;">.</span><span style="color: #000088;">$after_title</span><span style="color: #339933;">;</span></pre></div></div>

<p>Enacting this change will now display your &#8220;Display Name&#8221; after you login. Problem solved:</p>
<p><img src="http://www.steviebenge.com/wp-content/uploads/2008/09/picture-4.png" alt="" title="Greeting" width="265" height="147" class="alignnone size-full wp-image-132" /></p>
<p>The documentation for this plugin is not very complete so I did a <a href="http://www.google.com">Google</a> search to see if others had this quandary. Much to my surprise I didn&#8217;t find anything so I thought I&#8217;d share what worked for me.</p>
<p>Thanks to the documentation at the WP Codex and reading through some PHP code, it was a quick solution. Take a look at the <a href="http://codex.wordpress.org/Function_Reference/get_userdata">document</a> at <a href="http://codex.wordpress.org/Main_Page">WP Codex</a> to further experiment with your greeting.</p>
<p>Also thanks to <a href="http://blue-anvil.com/about">Mike Jolley</a> and his excellent <a href="http://blue-anvil.com/archives/wordpress-sidebar-login-2-optimised-for-wordpress-26">Sidebar Login</a> plugin!</p>
<p><strong>Update 4/20/2009:</strong><br />
Sidebar Login has been updated so it now uses &#8220;Display Name&#8221; by default.</p>
]]></content:encoded>
			<wfw:commentRss>http://superfancy.net/coding/simple-customization-wordpress-sidebar-login-plugin/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>SQL Buddy: A MySQL admin utility</title>
		<link>http://superfancy.net/coding/sql-buddy-mysql-admin-utility/</link>
		<comments>http://superfancy.net/coding/sql-buddy-mysql-admin-utility/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 05:31:41 +0000</pubDate>
		<dc:creator>Stevie</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.steviebenge.com/?p=111</guid>
		<description><![CDATA[While browsing through my RSS feeds last week I came across a post over at WebResourcesDepot about this really slick MySQL admin utility called SQL Buddy. It&#8217;s written in PHP and Ajaxed to the max! And it&#8217;s free! Needless to say I downloaded and tested it out immediately.


SQL Buddy runs in a web browser just [...]]]></description>
			<content:encoded><![CDATA[<p>While browsing through my RSS feeds last week I came across a <a href="http://www.webresourcesdepot.com/ajaxed-mysql-admin-sql-buddy/">post</a> over at <a href="http://www.webresourcesdepot.com/">WebResourcesDepot</a> about this really slick MySQL admin utility called <a href="http://sqlbuddy.com/">SQL Buddy</a>. It&#8217;s written in PHP and Ajaxed to the max! And it&#8217;s free! Needless to say I downloaded and tested it out immediately.</p>
<p><span id="more-111"></span></p>
<p><img src="http://www.steviebenge.com/wp-content/uploads/2008/08/picture-11.png" alt="SQL Buddy Screenshot" title="SQL Buddy Screenshot" width="500" height="375" class="alignnone size-full wp-image-112" /></p>
<p><a href="http://sqlbuddy.com/">SQL Buddy</a> runs in a web browser just like any other PHP app which is pretty cool. All you have to do is download the files, upload them to your webserver, and you&#8217;re off and running with pretty much zero configuration. And it&#8217;s even compatible with your browsers back and forward buttons!</p>
<p>It&#8217;s capable of just about everything that <a href="http://dev.mysql.com/downloads/gui-tools/5.0.html">MySQL Administrator</a> can do. I&#8217;ve been enjoying its ease-of-use. Definitely a pleasant way to take care of everyday MySQL admin tasks. It&#8217;s certainly not as powerful as something like <a href="http://mysql.navicat.com/mac_detail.html">Navicat</a> but admirably does a handful of things well. Take it for a test drive.</p>
]]></content:encoded>
			<wfw:commentRss>http://superfancy.net/coding/sql-buddy-mysql-admin-utility/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Setting up PHP, MySQL, and Apache in Mac OSX Leopard</title>
		<link>http://superfancy.net/coding/php-mysql-apache-in-mac-osx-leopard/</link>
		<comments>http://superfancy.net/coding/php-mysql-apache-in-mac-osx-leopard/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 05:23:22 +0000</pubDate>
		<dc:creator>Stevie</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.steviebenge.com/?p=33</guid>
		<description><![CDATA[One of the best features for web developers in Mac OSX Leopard is the inclusion of PHP and Apache. By default both are inactive and require you to get them ready for business. I will outline how to do this as well as get MySQL up and running so you can have a local development [...]]]></description>
			<content:encoded><![CDATA[<p>One of the best features for web developers in <a href="http://www.apple.com/macosx/">Mac OSX Leopard</a> is the inclusion of <a href="http://www.php.net/">PHP</a> and <a href="http://www.apache.org/">Apache</a>. By default both are inactive and require you to get them ready for business. I will outline how to do this as well as get <a href="http://www.mysql.com/">MySQL</a> up and running so you can have a local development setup right on your Mac!</p>
<p>It&#8217;s all pretty easy to do but requires a little attention to detail in parts. So lets get started.</p>
<p><span id="more-33"></span><br />
Most of the files we&#8217;ll be working with are actually hidden from Finder. If you use a text editor like <a href="http://www.panic.com/coda/">Coda</a>, <a href="http://www.barebones.com/">BBedit</a>, <a href="http://www.barebones.com/products/textwrangler/">Text Wrangler</a>, or <a href="http://macromates.com/">TextMate</a> you can choose to have hidden files &#8220;shown&#8221; so you can find them in your file structure. I personally use Coda so all that you have to do is click on the &#8220;View&#8221; menu and choose Show Invisible Files, as illustrated below:</p>
<p><img src="http://www.steviebenge.com/wp-content/uploads/2008/08/picture-2.png" alt="Coda: Show invisible Files" title="Coda: Show invisible Files" width="500" height="371" class="size-full wp-image-34" /></p>
<p>You can also run this simple Terminal command to &#8220;show&#8221; all hidden folders in Finder:</p>
<p><code>defaults write com.apple.finder AppleShowAllFiles TRUE</code></p>
<p>Then restart Finder by typing the following:</p>
<p><code>killall Finder</code></p>
<p>You should now be able to see all hidden files. </p>
<h2>PHP</h2>
<p>To enable PHP browse to Apache&#8217;s <code>http.conf</code> file located in <code>/etc/apache2/httpd.conf</code></p>
<p>Find this line:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">#LoadModule php5_module libexec/apache2/libphp5.so</pre></div></div>

<p>All you need to do is uncomment the line by removing the hash <code>#</code> symbol.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">LoadModule php5_module libexec/apache2/libphp5.so</pre></div></div>

<p>Now save <code>http.conf</code>. Don&#8217;t be alarmed if it asks for your system password&#8230; this is normal.</p>
<p>PHP 5.2.6 is the version shipped with Leopard. All the most popular extensions are already activated so you should be good to go. However if you need some of PHP&#8217;s extended features you may want to consider rebuilding PHP from source code as I&#8217;ve read the version that ships with Leopard has been problematic for some. I&#8217;ve never had any problems myself but it&#8217;s something to look out for. All relevant PHP settings are in the <code>php.ini</code> file. I won&#8217;t be covering any tweaks to that file in this article but you should be aware that it exists. By default, Leopard has an empty configuration file but provides a file which can be used as a template. From a new terminal window, type:</p>
<p><code>sudo cp /etc/php.ini.default /etc/php.ini</code></p>
<p>This creates your <code>php.ini</code> file, which is located in <code>/etc/php.ini</code> for your future reference.</p>
<p>You&#8217;ve now enabled PHP so lets move on to Apache.</p>
<h2>Apache</h2>
<p>Our friends at Apple were kind enough to ship a very modern version of Apache 2.2.6 for our development work. Kudos! To start up Apache click on the &#8220;Sharing&#8221; preference pane in System Preferences and enable &#8220;Web Sharing&#8221; like so:</p>
<p><img src="http://www.steviebenge.com/wp-content/uploads/2008/08/picture-3.png" alt="Enable Web Sharing" title="Web Sharing" width="500" height="317" class="size-full wp-image-40" /></p>
<p>You can also use the following command the start Apache from Terminal:</p>
<p><code>sudo apachectl start</code></p>
<p>You&#8217;ll be prompted for your system password. Type it in and press enter.</p>
<p>If you need to restart Apache, this will do the trick:</p>
<p><code>sudo apachectl restart</code></p>
<p>Keep in mind any editing you do to the <code>http.conf</code> or to the <code>php.ini</code> will require a restart of Apache. You can use the above command or simply restart &#8220;Web Sharing&#8221; in System Preferences&#8230; it&#8217;s up to you.</p>
<h2>Testing PHP</h2>
<p>So now hopefully if everything has gone according to plan, we&#8217;ll see some fruits of our labor. Go back to the &#8220;Sharing&#8221; Preference Pane in System Preferences and click on the URL/ IP Address below &#8220;Your computer&#8217;s website.&#8221; If all goes well you&#8217;ll see a page that says &#8220;Test Page for Apache Installation.&#8221; You can also type <a href="http://localhost/">http://localhost/</a> in your browser which will take you to the same place. </p>
<p>Now in your text editor create a PHP file and type the following code:</p>
<p><code>&lt;?php phpinfo(); ?&gt;</code></p>
<p>Save it in <code>/Library/WebServer/Documents/</code> (start from the top level directory of your hard drive, not the Library directory in your home directory) with the name <code>test.php</code>.<br />
Now type <a href="http://localhost/test.php">http://localhost/test.php</a> in your browser and you should see something like this:</p>
<p><img src="http://www.steviebenge.com/wp-content/uploads/2008/08/picture-4.png" alt="PHP Info" title="PHP Info" width="500" height="329" class="size-full wp-image-46" /></p>
<p>Great success!</p>
<h2>Setting up a personal website and virtual hosting</h2>
<p>If you&#8217;re the curious type and tried to click on &#8220;Your personal website&#8221; in the Web Sharing panel you may have noticed that you were greeted with a &#8220;Forbidden&#8221; message. So lets go ahead and set it up so you can serve up files from your &#8220;Sites&#8221; folder. Open up your text editor and create a file named after your &#8220;Home&#8221; folder. In my case it would be <code>StevieBenge.conf</code>. This file will live in <code>/etc/apache2/users/</code>. You&#8217;ll need to replace <code>StevieBenge</code> with the name of your &#8220;Home&#8221; directory. I&#8217;ve heard reports that this file is created automatically on new installs of Leopard but I had to create mine manually. Add the following code to the <code>.conf</code> file:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;directory &quot;/Users/StevieBenge/Sites/*/&quot;&gt;
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
&lt;/directory&gt;</pre></div></div>

<p>Like above, replace <code>StevieBenge</code> with the name of your “Home” directory. Save the file. This will allow Apache to serve files out of your &#8220;Sites&#8221; folder. Sweet! You&#8217;ll also need to restart Apache for this to take effect.</p>
<p>Moving right along, lets set up Apache for virtual hosts. Virtual hosts are essential if you want to serve multiple websites from your &#8220;Sites&#8221; folder. You can choose pretty much any &#8220;domain&#8221; name you want or mirror any production sites you have hosted on a live server. I like to name all of my local development sites with the extension <code>.dev</code> to keep easy track of things. Getting virtual hosts to work in Leopard was a huge stumbling block for me because of a lot of misinformation I read around the internet. I was was really happy to finally get this working. And as you&#8217;ll see it&#8217;s pretty straightforward.</p>
<p>So to get started, browse to <code>/etc/hosts</code> and add the following to the end of the file:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># Local aliases
127.0.0.1 steviebenge.dev</pre></div></div>

<p>Remember to change <code>steviebenge.dev</code> to the name of a site in your &#8220;Sites&#8221; folder. <code>127.0.0.1</code> is an IP Address that tells your Mac that your site is hosted locally. The site will only be accessible on your Mac. Now we&#8217;ll need to reopen the<code>.conf</code> file we created earlier in <code>/etc/apache2/users/</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;directory &quot;/Users/StevieBenge/Sites/*/&quot;&gt;
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
&lt;/directory&gt;
&nbsp;
NameVirtualHost *:80
&nbsp;
&lt;virtualhost *:80&gt;
    DocumentRoot /Users/StevieBenge/Sites/steviebenge.dev
    ServerName steviebenge.dev
&lt;/virtualhost&gt;</pre></div></div>

<p>Again make sure to change the directory structure above to reflect your &#8220;Home&#8221; folder and the folder within your &#8220;Sites&#8221; folder you want to serve files out of. Restart Apache for the changes to take effect. So to test it out and make sure everything&#8217;s working properly, go ahead and move the <code>test.php</code> created earlier into your new directory in your &#8220;Sites&#8221; folder. If it&#8217;s successful you&#8217;ll again see:</p>
<p><img src="http://www.steviebenge.com/wp-content/uploads/2008/08/picture-4.png" alt="PHP Info" title="PHP Info" width="500" height="329" class="size-full wp-image-46" /></p>
<p>Too add more virtual hosts run through the above steps again. Simple as that!</p>
<h2>MySQL</h2>
<p>Now here is where the fun begins. It&#8217;s odd that Apple didn&#8217;t include MySQL with Leopard as it&#8217;s pretty much synonymous with PHP. Anyway, you have a couple options for installing MySQL on Leopard. You can roll your own and compile and install from source code or use MySQL&#8217;s package installer for Leopard. I won&#8217;t discuss how to compile MySQL here but I did find an excellent tutorial on how to do this over at Dan Benjamin&#8217;s <a href="http://hivelogic.com/articles/2007/11/installing-mysql-on-mac-os-x">Hivelogic</a> site. I came pretty close to giving this a shot but I opted for the MySQL package installer. Dan brings up many salient points on why it&#8217;s beneficial to compile your own install in his tutorial, so I&#8217;d highly recommend checking it out. </p>
<p>So head over to the <a href="http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg">MySQL</a> downloads page and grab a copy of the Mac OS X 10.5 (x86) installer (currently 5.0.67). You can also optionally download the <a href="http://dev.mysql.com/downloads/gui-tools/5.0.html">MySQL GUI Tools</a>, which I would recommend as that is how I prefer to administrate MySQL. The Mac Installer is labeled MAC OSX 10.4 (Universal binaries) but, in my experience, it will work without issue on Leopard.</p>
<p>Install MySQL and the GUI Tools. There&#8217;s also a Preference Pane that you can install that allows MySQL to be stopped and started from System Preferences. Go ahead and install that as well.</p>
<p>After you install the MySQL Preference Pane, find it in System Preferences and start MySQL like so:</p>
<p><img src="http://www.steviebenge.com/wp-content/uploads/2008/08/picture-6.png" alt="MySQL Preference Pane" title="MySQL Preference Pane" width="500" height="218" class="size-full wp-image-63" /></p>
<p>If you prefer starting MySQL from Terminal, you can do so with this command:</p>
<p><code>sudo /usr/local/mysql/support-files/mysql.server start</code></p>
<p>And you can use this command to stop MySQL:</p>
<p><code>sudo /usr/local/mysql/support-files/mysql.server stop</code></p>
<p>Now we&#8217;ll need to put the <code>mysql.sock</code> in the proper directory so MySQL can communicate with PHP.</p>
<h2>Getting MySQL and PHP to communicate</h2>
<p>The default location of <code>mysql.sock</code> is in the <code>/tmp/mysql.sock</code> directory. We&#8217;ll need to change this to <code>/var/mysql/mysql.sock</code> as this is where PHP will look for it.<br />
So first off, create a <code>my.conf</code> (or in this case <code>my.cnf</code>) file in your text editor and save it as <code>my.cnf</code> in the <code>/etc</code> folder with the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[client]
socket = /var/mysql/mysql.sock
&nbsp;
[mysqld]
socket = /var/mysql/mysql.sock</pre></div></div>

<p>Next move <code>mysql.sock</code> to it&#8217;s new directory by typing the following code in a Terminal window:</p>
<p><code>sudo mkdir /var/mysql</code><br />
<code>sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock</code></p>
<p>Believe it or not, that&#8217;s pretty much it. One thing to keep in mind is the MySQL GUI Tools will still look for the <code>mysql.sock</code> in the old location so when you log in to MySQL Administrator enter <code>/var/mysql/mysql.sock</code> in the &#8220;Connect Using Socket&#8221; box under More Options:</p>
<p><img src="http://www.steviebenge.com/wp-content/uploads/2008/08/picture-7.png" alt="MySQL Administrator" title="MySQL Administrator" width="419" height="354" class="size-full wp-image-65" /></p>
<p>Now you&#8217;re ready to create your first MySQL Database. The MySQL Administrator makes this really easy, which I will cover in a future article. You can also administer your MySQL databases from Terminal. As I stated earlier, I prefer the GUI Tools but learning how to do things from Terminal is a useful skill to have. It&#8217;s totally up to you.</p>
<h2>Bonus Information</h2>
<p>I&#8217;ve read that you can also deal with the <code>mysql.sock</code> issue by editing the <code>mysql.default_socket =</code> line in your <code>php.ini</code> file to reflect the location of <code>mysql.sock</code>. I chose not to do this, but it may work for others</p>
<p>You may want to to change <code>php.ini</code> to report all PHP errors while you are in development. This can be done locating the following line:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">error_reporting = E_ALL &amp; ~E_NOTICE</pre></div></div>

<p>And changing it to:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">error_reporting = E_ALL</pre></div></div>

<p>This is fine in your local development setup but of course not advised for a production server.</p>
<p>At the beginning of this article I illustrated how to &#8220;show&#8221; hidden files in Finder. Here&#8217;s that Terminal command again:</p>
<p><code>defaults write com.apple.finder AppleShowAllFiles TRUE</code><br />
<code>killall Finder</code></p>
<p>You can also &#8220;hide&#8221; those same hidden files with this command:</p>
<p><code>defaults write com.apple.finder AppleShowAllFiles FALSE</code><br />
<code>killall Finder</code></p>
<p>Another great resource for an all-in-one development setup is <a href="http://www.mamp.info/en/index.php">MAMP</a>. Using MAMP negates the need to do any of the above tweaking as it has its own versions of Apache, PHP, and MySQL. It&#8217;s perfect for those that want to get up and running quickly with a minimum of fuss.</p>
<h2>Conclusion</h2>
<p>Well this should get you started with PHP, MySQL, and Apache in Mac OSX Leopard. My inspiration for writing this article was to combine a lot of the information I read from other sites while getting my MacBook Pro set up. Many of the articles I came across were written around the time Leopard was released last Fall so some of the information was a bit out of date. Not that any of the above methods are terribly original on my part, but I&#8217;d like to credit some of the sources that helped me:</p>
<p><a href="http://www.procata.com/blog/archives/2007/10/28/working-with-php-5-in-mac-os-x-105/">procata.com</a>: This was the best resource I found and well worth checking out as it shows you how to install the <a href="http://pear.php.net/">PEAR</a> extension. Has some great tips that I didn&#8217;t cover here.</p>
<p><a href="http://dev.mysql.com/doc/refman/5.0/en/mac-os-x-installation.html">Installing MySQL on Mac OS X</a>: MySQL&#8217;s own how-to guide.</p>
<p><a href="http://adactio.com/journal/1395">adactio.com</a>: Jeremy Keith&#8217;s guide.</p>
<p><a href="http://foundationphp.com/tutorials/php_leopard.php">foundationphp.com</a>: Excellent screen shots with this PHP and Apache tutorial.</p>
<p>Thanks for reading and check back as I&#8217;ll be writing more articles about working with PHP, MySQL, and Apache. Feel free to keep the discussion going in the Comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://superfancy.net/coding/php-mysql-apache-in-mac-osx-leopard/feed/</wfw:commentRss>
		<slash:comments>74</slash:comments>
		</item>
	</channel>
</rss>
