Saturday, October 22, 2005

Daily devotions - getting started

I spent today getting started on my Daily Devotions software project, that I mentioned in my previous post. So much trial and error was involved for a PHP novice like me I decided to document it here.

The first thing I decided was I would try and procede in an XP (eXtreme Programming) style way. This involves many things, including writing stories on cards for what you want the software to do, and then proceeding forward in very small steps. This is ideal for a project like this I'm doing in my spare time. Unfortunately, some of the other practices like pair programming I will not be able to do as an individual, but we will see how it goes.

The first story I started with was "show a web page with the correct 'Through the bible' reading for that day on it". So the first thing I needed was some webhosting. I found "Perfect Free Web Hosting" (PFWH) which offes free MySQL and PHP as well as webhosting. Another option was MyJavaServer which offers free Java as Hypersonic SQL. I decided to go with PFWH as:
  • it gave me an opportunity to learn PHP
  • it meant I was likely to resist the temptation to make things too complicated starting in Java
  • it was likely to be able to move the site to somewhere else fairly easily, as lots of people offer PHP and MySQL, including BlackCat, who I use to host this site
  • I thought I was going to need a database to store the lists of readings. I could have used a flat file, but I've learnt its usually better in the end to start with a database, you always want one ventually. And I couldn't find a flat file database that worked easily with PHP and Java, if I wanted to change languages in the future. If I use MySQL then I can swap to another language very easily.

So having done this, the first step in XP is always to write a testcase. Now, I normally develop in Java where I am spoilt having IntelliJ IDEA, the best IDE I've ever come across for any language, with fantastic JUnit integration. I wanted something as similar as possible for PHP.

I spent all of today searching and to save you the effort, here is the configuration I ended up with. It turns out that if you are paying for an IDE for PHP then Zend Studio seems like the only choice, but I'm a cheapskate, so couldn't go for that. After much trial and error I finished up with PHP-Eclipse, with a local copy of Apache and MySQL for development, before deployment to PFWH. I installed Apache, PHP and MySQL through XAMPP. This took quite a few tries to get it right. I'm sure there are lot's of other solutions to get a free PHP IDE with PHPUnit etc, but I recommend following these instructions exactly.

Make sure you follow just that page. Even following the other instructions on the PHP-Eclipse Wiki it is possible to get in a mess, with editing files etc. Use the page linked to above. That's why I haven't added any other links, as that page has all you need to get set up on it. And now I have an IDE which will create PHP that connects to a local MySQL and Apache, within the IDE.

It also gives me the benefit of gaining familiarity with Eclipse, which is something I've been meaning to do.

4 comments:

Anonymous said...

Good design!
[url=http://xxzwcclo.com/czji/nwwu.html]My homepage[/url] | [url=http://nzogznwh.com/ngdp/kuri.html]Cool site[/url]

Anonymous said...

Well done!
http://xxzwcclo.com/czji/nwwu.html | http://iocuilio.com/tqrj/lruu.html

Anonymous said...

Well done!
My homepage | Please visit

Anonymous said...

Well done!
http://himbeowt.com/fpss/gefk.html | http://uvytvdbe.com/bzxb/wlag.html