Ajax and Ajax Frameworks

I have been a developer for nearly 20 years and a web developer for about 10 years. Over the years, I have considered creating a blog to share the things I have learned (and am learning) about web design and development, but I never seemed to have the time. When I began learning about web development using Ajax and Ajax Frameworks, I decided to take the time to create this blog.

My intention for this blog is to focus primarily on Ajax Frameworks, but since web development requires knowledge of many technologies, I will occasionally write about things such as CSS, Javascript, PHP, MySQL, Flash, etc.

Lately, I have been using JQuery as my primary Ajax tool. Although I have used other Ajax Frameworks in the past (Dojo Toolkit, Yahoo! User Interface Library, Scriptaculous/Prototype), JQuery has thus far been the easiest to learn. In my first few posts I will discuss some of the JQuery Plugins that I have created. Some of these include: a plugin for Google Maps (jquery.imGoogleMaps), Form validation and submission  (jquery.imValidateForm), Page Populater (jquery.imPagePopulate), and a plugin to create lists (jquery.imList).

While I am still learning about some of the other Ajax Frameworks, I hope that what I have learned will be helpful to others. Just remember, “When you can pull the pebbles from my hand…”

Share

Mac OS X: Configuring PHP With GD Support

Friday, June 19th, 2009

A few days ago, I was testing a PHP class I created that uploads images and creates thumbnails. I ran into an error when I called imagecreatefromjpeg. phpInfo() revealed that the GD Library was not installed on my Mac G5. All the sites I visited said that I would have to recompile PHP with GD support enabled. I considered working on my PC rather than recompiling PHP, but my Mac has become my primary development box, so I knew that I would need the GD Library for future projects.

Initially, I considered a new entropy PHP package. I used the entropy version a few years ago, but I ran into problems after I installed Leopard. I was fairly confident that entropy would now “play nice” with Leopard, but I wasn’t sure what it would do to my existing MySQL database.

I then considered using MacPorts to install PHP, but decided against it, because I wanted to use my existing infrastructure, not a re-installation of everything (Apache, PHP, and MySQL). If you haven’t yet started any development on your Mac, then I recommend that you use the MacPorts package. I found great instructions here.

So I made the decision to just recompile PHP with GD Support. After a few hours, I began to think that this was not a good decision. I was following the step-by-step instructions that I found here.

First I had to download and install a new version of Xcode because during one of the steps, I received the error, “C compiler cannot create executables”. Although Xcode was already installed on my Mac, it was an older version.

I then received an error when I tried to compile the GD Library (under the section: Download and Compile GD Graphics Library extension). The error was due to the t1lib not being installed. I recommend that you do a search for the t1lib after you install Xcode. If it is not present, you can go here for download/installation instructions.

One of the last steps involves confirming that PHP is loading the gd.so extension.

/usr/bin/php -i|grep -i gd

I received the error:

PHP Warning:  PHP Startup:
Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20060613/gd.so'
- (null) in Unknown on line 0

I simply copied the gd.so file from /SourceCache/php-5.2.8/ext/gd/ to /usr/lib/php/extensions/no-debug-non-zts-20060613/. I then received the confirmation:

gd
GD Support => enabled
GD Version => bundled (2.0.34 compatible)

Additional Notes

1. Under the section, “Download and compile the GD graphics library extension”, the step refers to php 5.2.6. I changed it to php 5.2.8. Actually, I opened my browser and navigated to: http://opensource.apple.com/. I then selected the version of Mac OS X that I am using (10.5.7). I then scrolled down the list and selected apache_mod_php-44.2 and found php-5.2.8.tar.bz2. So my curl statement was:

curl -O http://www.opensource.apple.com/darwinsource/10.5.7/
apache_mod_php-44.2/php-5.2.8.tar.bz2

2. A few of the steps require you to type:

make install

You really have to type:

sudo make install

or you will receive an error. Enter your password as required.

While recompiling PHP with GD support is not for the faint of heart, it can be done. Now I can get back to work.

Share

2 Responses to “Mac OS X: Configuring PHP With GD Support”

  • Scott Says:

    Awesome – thanks! Definitely save me a lot of time with this tutorial!

    Thanks!

  • Alan Says:

    Very Helpful. Thanks!

CommentLuv badge