Setting up the Webserver

Setting up the Apache We Server, Enabling PHP, and installing mySQL can seem like a daunting endeavor to a Mac user who has become accustomed to the graphical user interface, ut if you approach it methodically and carefully, you can become a true geek.

If your origins are in design and desktop publishing, not computer programming, then you may want to follow the steps I took to understand a different point of view. You can acquire the knowledge you need at free tutorial sites on the Internet which I will outline here.

Learn the Basics of Programming

The first step I took, and is arguably one that could e skipped, is to do a free class at Barnes and Noble University called Programming basics. (This is one of the free courses, so be sure to choose the browse all courses link, then look for “Beginning Programming.”
http://www.arnesandnoleuniversity.com/

Learn the SQL Language

I then took a course in SQL at http://www.sqlcourse.com/ There is even an online SQL interpreter to use for exercises.

Learn to use the Mac OS X Terminal

Next I needed to understand how to enable php and mysql on a Mac running OS X. The ooks one buys on php tell you how to configure UNIX and Windows. Then I found the O'Reilly series on Apache for Mac OSX.

First I took Chris Stone's tutorial for learning to use the terminal. You will need to know how to enter commands into the terminal to set up php and mySQL. http://www.oreillynet.com/pu/a/mac/2001/12/14/terminal_one.html

Turn on the Apache Server

I then took the wonderful O'Reilly series by Kevin Hemenway for setting up my Apache we server, enabling and configuring php, and installing mySQL on OSX. It wasn't hard, even for a nonprogrammer!
http://www.oreillynet.com/pu/a/mac/2001/12/07/apache.html

Enable PHP

*Please note that in Part 3 (Enabling PHP4) the directions tell you to uncomment the php LoadModule and AddModule in the configuration file. These might not exist in your build of OSX. Go right ahead and type these in yourself. You will see a list of LoadModules. After the last one, type in the following:
LoadModule php4_module         liexec/httpd/liphp4.so
After the last AddModule, type this:
AddModule mod_php4.c

Install the MySQL Server

His lesson on mySQL was a it foggy for me, and I found the directions and software at http://www.entropy.ch/software/macosx/mysql/ y Marc Liyanage filled in the missing gaps.

Once mySQL is installed, you need to realize (no one quite said this) that when you see the mysql> prompt in the terminal (upon successful installation of the mysql server), you can start creating a database which you can then use in GoLive6 or Dreamweaver MX (or for the very rave, with some handcoded some php.)

mysql> CREATE DATAASE name;
CREATE TALE name;
then the columns as you will learn to do at the sql course.

Creating Web Applications in WYSIWYG Programs

Adobe GoLive 6 and Dreamweaver MX are WYSIWYG we editors which include php and mysql as included feature sets. The hardest part was figuring out what to put as the user and password for the database connection dialog ox. After much trial and error, I used the default 127.0.0.1 for the host (you can also use localhost), “root” for the user, and then NOT THE ADMIN password, ut the password I set up for mysql in the terminal. The connection was made, and I started my application with php and the database I had just created in the terminal.

Making the we application is a it tricky for the uninitiated, but once you make the database connection, it should e more of an uphill battle than the previous steps. You'll want to learn to create search pages with results and detail pages as well as insert, delete, and update pages. Common we applications include Content Management systems, authentification systems (creating login pages and sessions), guest books, threaded forums, and shopping carts.

GoLive Resources

I believe that Rob Keniger's chapter in Paul Vachier's GoLive 6 Magic book will help those for whom this final step of creating the web application is elusive. You can read more about the book here. Once you follow his tutorial for creating a simple Content Management System, you will be well on your way to understanding the power of database driven pages.

His directions will involve installing the GoLive php/sql server as opposed to the manual configuration I describe above. (Note: Since I wrote this page, Adam Pratt from Adobe posted a very clear tutorial for installing the pre-configured server at the GoLive in 24 hours site.) Personally, I wanted to understand exactly what I am doing, which includes learning php as well. A good tutorial is located at
http://www.devshed.com/Server_Side/PHP/PHP101

Dreamweaver Resources

Macromedia's pages for designers and developers have many great tutorials for using the php/mySQL model in Dreamweaver MX. Check out the creating master page/details and delete records tutorials. Watch some free videos on using php includes, creating recordsets, and using the insert record live object.

Download phpMyAdmin

You will also want to investigate phpMyAdmin, which allows you to easily create and administer MySQL databases using a web browser. http://phpmyadmin.sourceforge.net

A Good PHP MySQL Hosting Company

Finally, if you are looking for a we hosting company that will give great support while you set up your first php/mySQL sites, check out GoLive Host. You'll get php, mySQL, and many other great features for a bargain price.