HTML, XHTML and CSS All-In-One for Dummies - Andy Harris [324]
♦ A data server: Many of your programs work with data, and they need some sort of application to deal with that data. The most common data server in the open-source world is MySQL. This data package is free, powerful, and flexible. The data server is also running in the background all the time. You have to configure PHP to know that it has access to MySQL.
♦ A mail server: If your programs send and receive e-mail, you need some sort of e-mail server. The most popular e-mail server in the Windows world is Mercury Mail, and Sendmail is popular in the world of Unix and Linux. You probably won’t bother with this item on a home server, but you should know about it when you’re using a remote host.
♦ An FTP server: Sometimes, you want the ability to send files to your server remotely. The FTP server allows this capability. Again, you probably don’t need this item for your own machine, but you definitely should know about it when you use a remote host.
♦ phpMyAdmin: There’s a command-line interface to MySQL, but it’s limited and awkward. The easiest way to access your MySQL databases is to use the phpMyAdmin program. Because it’s a series of PHP programs, it requires a complete installation of PHP, MySQL, and Apache (but, normally, you install all these things together anyway).
Creating Your Own Server with XAMPP
If the requirements for a Web hosting solution seem intimidating, that’s because they are. It’s much more difficult to set up a working server system by hand than it is to start programming with it.
I don’t recommend setting up your own system by hand. It’s simply not worth the frustration, because very good options are available.
XAMPP is an absolutely wonderful open-source tool. It has the following packages built in:
♦ Apache: The standard Web server and the cornerstone of the package
♦ PHP: Configured and ready to start with Apache and MySQL
♦ MySQL: Also configured to work with Apache and PHP
♦ phpMyAdmin: A data management tool that’s ready to run
♦ Mercury Mail: A mail server
♦ FileZilla FTP server: An FTP server
♦ PHP libraries: A number of useful PHP add-ons, including GD (graphics support), Ming (Flash support), and more
♦ Additional languages: Perl, another extremely popular scripting and server language, and SQLite, another useful database package
♦ Control and configuration tools: A Control Panel that allows you to easily turn various components on and off
This list is a description of the Windows version. The Mac and Linux versions have all the same types of software, but the specific packages vary.
Considering the incredible amount of power in this system, the download is remarkably small. The installer is only 34MB. A copy is included on the CD-ROM that accompanies this book.
XAMPP installation is pretty painless: Simply download the installer and respond to all the default values.
If you use Vista or Windows 7, you may want to change where the package is installed because the program files directory causes problems for some users.
Running XAMPP
After you install XAMPP, you can manage your new tools with the XAMPP Control Panel. Figure 1-1 shows this program in action.
Figure 1-1: XAMPP Control Panel allows you to turn features on and off.
Some components of XAMPP (PHP, for example) run only when they’re needed. Some other components (Apache and MySQL) are meant to run constantly in the background. Before you start working with your server, you need to ensure that it’s turned on.
You can choose to run Apache and MySQL as a service, which means that the program is always running in the background. This arrangement is convenient, but it slightly reduces the performance of your machine. I generally turn Apache on and off as I need it and leave MySQL running as a service because I have a number of other programs that work with MySQL.
Leaving server programs open on your machine constitutes a security hazard. Be sure to take adequate security precautions. See the section “Setting