Building PHP in Leopard

December 11th, 2007 2 Comments »

Like many of you, i’m sure, I was impressed with Apple’s inclusion of PHP 5 in Leopard.  For nearly 2 months,  i’ve been using the default PHP install without a single complaint.  It worked just fine,  had mysql support,  and worked with mostly everything i’d been working on.  Eventually, however, I needed more out of php than the base install allowed for. I needed the SOAP extension, I needed OpenSSL support, I needed mcrypt,  I wanted JSON,  I wanted GD.  (Actually, I needed those things for work, minus GD.)

Initally,  I simply downloaded PHP 5.2.5 from php.net and started to build.  I found out that some of the libraries I wanted to include weren’t included in OS X,  so I had to install them first.

Leopard includes XML libraries, so the SOAP extension works out of the box.  OpenSSL also works out of the box.  Mcrypt was the first extension that needed to be built.  It worked like this:

Download libmcrypt

cd <libmcrypt dir>
./configure --disable-posix-threads
make
sudo make install

Now you’ve got libmcrypt installed,  the next extension that needs anything installed is GD.  I won’t bother telling you how to install GD. I just used libpng, because PNG’s are what I work with.

That wraps up what I needed before I could build PHP.  It was time to download the PHP 5.2.5 source, and get rolling.  Here was how I configured PHP:

./configure --with-zlib --with-mysql=/usr/local/mysql --with-apxs2=/usr/sbin/apxs --enable-soap --with-openssl --with-mcrypt --with-gd
make
sudo make install

At this point,  your install will complain about apxs.  I attempted to restart apache,  but I had no success.  Calling :  apachectl -t  gave me a warning about libphp5.so no loading properly, due to the wrong architecture.  file libphp5.so reported that I had the right arch, so I was stumped.  I was left with apache 2 not being able to load my php module.

I tried a bunch of different things to fix the problem, but eventually solved it simply by rebuilding apache.  Just download httpd 2.2.3 (current as of this writing),  configure as you’d like (a simple ./configure will work without any options), make, sudo make install,  and then restart apache.

Voila,  you’re running the latest & greatest PHP and Apache on the latest & greatest Mac OS.

jQuery Lightbox, now at Google Code

December 4th, 2007 No Comments »

A group of people have been submitting issues / fixes via comments and email. Since I don’t get a chance to work on this package very often, I figured the best thing to do would be to open it up to the community.

Last week, I set up a google code project for jQuery Lightbox. I can have an issue tracker, other developers, download management, and full on community SVN for everyone to use. I’ll still post updates to the package on here, but hopefully we can get everyone using it to move over there, and keep it up to date.

You can access the project at http://code.google.com/p/jquery-lightbox/

Cheers!

jQuery Lightbox, ActiveRecord, and good times

October 12th, 2007 3 Comments »

There haven’t been any updates to the to the jQuery Lightbox in a couple of weeks. Hopefully, i’ll get to update the script this weekend, and knock out the last few bugs people have brought up. The script still needs a new name, as well. Any takers on that one?

I put down PHP for a few days last month, and tried to pick up Ruby On Rails again. Certain things about rails just seemed to nicie to have. After a good bit of playing around, i’m convinced that it’s a decent framework. I’m not convinced enough, however, to drop 7 years of PHP experience to jump ship just yet. The main selling point of Rails, for me, was ActiveRecord. In my experience, PHP doesn’t have any great libraries that offer the same functionality. After doing a bit of reading (http://sneer.org/archives/2005/01/02/active_record_in_php_5_part_1/), however, I’ve adapted my own set of classes that seem to be working just as I want them to. They handle implementing the Active Record design pattern nicely, and also handle ORM and various other points of business logic (validating input, enforcing datatypes,  automating outputs) quite nicely.  I’m implementing them in my latest project at work.  If it goes off well there,  i’ll most likely bring them online for people to critique / improve.  In fact, I believe i’ll do that this weekend anyway.  No harm, no foul, right?

Anyway,  jQuery Lightbox will be up in the near future, and i’ll offer a compressed version along-side the regular version, which will hopefully keep some people happy.

Cheers!

A Simple Quote

September 15th, 2007 No Comments »

“Simplicity means the achievement of maximum effect with minimum means.”

— Dr. Koichi Kawana

A word on the jQuery Lightbox

September 13th, 2007 1 Comment »

It’s been a while since i’ve posted an updated to the jQuery Lightbox script I uploaded.  Don’t worry,  I haven’t forgotten it,  and I know that there are still bugs to be fixed.  I simply had a few busy weeks with work, followed by a much needed vacation.  There should be a new version online in the near future.  Here’s what I plan to address in the next release:

  • After closing the lightbox, it sometimes doesn’t re-open
  • In Firefox 2.0+ you get scrollbars when you click the close button
  • Overlay doesn’t resize when you resize the window.