IE Debugging Tools

Posted by John
on Monday, 25 February 2008

It's hard to do but these might help,

  • X-Ray, a bookmarklet to examine elements within the document model, similar to firebug's 'inspect'.

  • Fiddler, an http debugger for ie 6/7

  • IE Developer Toolbar, similar in power to firebug but in no way as comprehensive.

  • IETester, full-blown IE6 standalone browser, finally you can test against IE6 on Vista!

Need Xcode to Build Mongrel on Leopard

Posted by John
on Friday, 14 December 2007

Quick note, you'll need the latest build of Xcode (which comes with the Apple GCC compiler) to build mongrel server on Leopard.

It being all super 64-bit OS'ey ;-)

Get this from Apple Developer Connections, using your Apple Account.

Note: big download, around 600mb so get a coffee while you wait,

Once installed, run this in Terminal (open a new window with applekey+N),

sudo gem install mongrel

Not forgetting the ever-lovely deprec,

sudo gem install deprec

(which comes with capistrano 1.4.1)

And a of couple updates with...

sudo gem install rails
sudo gem update --system
sudo gem install tzinfo
sudo gem install RedCloth

(p.s. you don't need SSHKeyChain with Leopard, so skip installing that)

Enjoy,

Apache 2.2 + PHP on a MacBook ?

Posted by John
on Monday, 19 November 2007

Being a developer and today being my trip to the dentist (and a day off work), I tend to get bored really really easy.

And knowing tomorrow I've got to work with JSON I thought I'd show you how easy it is to install and compile Apache 2.2 Web Server and Enable PHP 4 on your MacBook, so you can get to and build PHP apps natively on OSX.

Now obviously you could download MAMP to get up and running fast, but really that's just not geeky enough for us hard-core developers, so let's begin.

Apple Developer Tools Required

Yes, to build from source you're going to need the GCC compiler which can be obtained for the Apple Developer Connection website (free), search my searchbox for a link otherwise just download from their site.

Apache 2.2

Installing Apache 2.2 Web Server

First goto the Apache site and download the latest sourcecode to your desktop.

Once downloaded, do the following in your TERMINAL window;

cd desktop
gnutar -xzf httpd-2.2.6.tar.gz
cd httpd-2.2.6

Now we've untar'd it to the desktop and have navigated into it, let's build from source.

Run this to setup the sourcefiles for your machine and build spec,

./configure --enable-module=most --enable-shared=max

Now compile the sourcecode, and install

make
sudo make install

Bingo, you now have Apache 2.2 (or whatever version your downloaded) installed on your MacBook.

Starting & Stopping Apache2

Start with...

sudo /usr/local/apache2/bin/apachectl restart

Stop with...

sudo /usr/local/apache2/bin/apachectl stop

Running PHP on OSX

Enabling PHP 4 ?

Now every MacBook comes with PHP4 installed as standard, it just waits until you enable it to work.

So to enable it, type in TERMINAL;

cd /etc/httpd
sudo mate httpd.conf

This will navigate to the httpd Apache config file and open it's INI file in TextMate (I'm baised but you can use NANO or TextEdit if you like to edit the file).

When you've got the file open, search for 'PHP' anywhere in the file.

You should see two occurences, commented out with #'s remove these to enable PHP.

# LoadModule php4_module libexec/httpd/libphp4.so
# AddModule mod_php4.c

Now save and close the file

And restart Apache

sudo apachectl restart

Stop with...

sudo apachectl stop

Hang on this isn't Apache 2.2?

Now what this will do is startup your Mac's native Apache server (which isn't 2.2), sorry but I haven't worked that one out.

Your fresh 2.2 build will also have an *httpd.conf file in...

cd /usr/local/apache2/conf
sudo mate httpd.conf

To edit it's config file, sorry I haven't an answer at the moment but I'll figure it out.

Next question,

Where to stick my WebPages?

First make sure Personal Web Sharing is enabled in System Preferences / Sharing.

Next in your user directory (or the first directory you appear in when opening TERMINAL), create a directory called...

mkdir Sites

Now everything you stick in this directory will be acted upon like it's a website (including PHP).

To test your PHP setup works, create a file in there called test.php and add this in it...

<?php phpinfo() ?>

Now before you leave System Preferences / Sharing, click the info link by Personal Web Sharing.

This will display a dialog and at the bottom of this will be some web addresses, the one's for the web server running on your machine!

Click on one and bookmark the link.

Add /test.php to the end and run it in Firefox or Safari, you should now see the version of PHP installed on your system.

Well done, you have now successfully installed PHP and Apache2 from source on your MacBook.

Enjoy and when I can figure out how to replace Apple's native 1.3 Apache server with 2.2 I'll let you know, but for now it works.

Learning Javascript

Posted by John
on Tuesday, 06 November 2007

For many it can be one heck of a steep hill to climb, thankfully the Yahoo guys and a few others have released some online videos to help you out.

Worth the watch,

More...