A Portable Apache+PHP Environment for Debian/Ubuntu and MacOS X (aka Dynamic vhosts made Easy)

The very first thing you need to do to develop for PHP is to setup a development server with PHP installed, of course. But maybe you're somewhat new to PHP and Apache is a huge, mind numbing universe of options. All you really want is the ability to run PHP and map hostnames to code, right? Almost always that's my goal, anyway.

Well, I've done all the work for you. Congrats! Actually, I did it mostly for myself and I'm sharing it with you! Yay for us!

Read more: A Portable Apache+PHP Environment for Debian/Ubuntu and MacOS X (aka Dynamic vhosts made Easy)

Apache AutoIndexer with jQuery

Apache's mod_autoindex is really rather boring on the surface.  However I will show you there is quite a lot you can do with it given a little understanding of how it functions.  If you need a file listing this is an excellent means to accomplish that goal.  You can wrap the auto-generated output with simple HTML, PHP, Perl or any other file type Apache can process.

In our case, we aren't going to generate anything using PHP or SSI or any other server-side mechanisms.  We are going to create a custom header and footer which wraps the basic unordered list output format with CSS and jQuery calls.  We will create the .htaccess file and other supporting files at the root of a /images folder on our server; in my case this is a Joomla installation's uploaded images folder.  I just want a quick and dirty means for authors to browse images uploaded into certain folders of this system.

Read more: Apache AutoIndexer with jQuery

Whitespace Matters!

Lets start at the beginning. Lets start with creating a blank PHP script. What's one of the most important things to remember when creating a new PHP script?

Whitespace Matters!

You must keep track of your whitespace in PHP scripts.

HTTP headers cannot be set if you have already "printed" any characters.

I run into this over and over and over and over in modifying carelessly written code.

Read more: Whitespace Matters!

MySQL Master-Master-Slave(s) Database Replication

I have watched the technology sessions and slideshows explaining how many large websites, such as Google or Facebook, setup their MySQL Databases. But none have ever gone into the details of how to configure MySQL in such a way. So I had to tackle that myself. I am documenting the process here so its hopefully useful to others (and myself when I forget in 6 months).

Read more: MySQL Master-Master-Slave(s) Database Replication