< Day Day Up > |
A.4 Downloading and Installing PHP's FriendsTo build a web site with PHP, you need a web server. Apache is the most popular web server in the world. It's free, powerful, stable, and secure. What more could you ask for? You probably want a database program to use with your web site. One of the most common choices for a database program to go along with PHP is MySQL. This section shows you how to install Apache and MySQL on your computer. The instructions in this section are only for people who are installing PHP on their own computers. If you are using a web-hosting provider's PHP setup, then don't install Apache and MySQL yourself. Your hosting provider has taken care of that for you. A.4.1 Installing ApacheHow you install Apache depends on what operating system you're using. Follow the appropriate instructions for your platform. A.4.1.1 Apache on WindowsTake the following steps to install Apache on Windows:
Figure A-18. Selecting the Typical Apache installationFigure A-19. Selecting the Apache installation folderApache is now set up and ready for PHP to be installed. A.4.1.2 Apache on OS XApache comes preinstalled with OS X. The preinstalled version of Apache is required to work with the www.entropy.ch PHP package. You must turn on Personal Web Sharing in the Sharing panel of the Internet & Network section of the System Preferences application to activate Apache. Figure A-20 shows the Sharing panel. Figure A-20. Turning on Personal Web SharingA.4.1.3 Apache on LinuxApache comes preinstalled on most Linux distributions. If it is not installed, you can install Apache RPMs or packages. Look for Apache packages for your distribution. In Fedora Linux, these packages are the httpd, httpd-devel, and httpd-manual RPMs. In Debian Linux, the appropriate packages are apache, apache-common, and apache-dev. If prebuilt packages aren't available for your distribution, you can download the source code for Apache from http://httpd.apache.org/download.cgi and build it by following the instructions at http://httpd.apache.org/docs-2.0/install.html. A.4.2 MySQLBinary MySQL packages are available for all common operating systems. For MySQL 4.1, go to http://dev.mysql.com/downloads/mysql/4.1.html. If you must use the older 4.0 version of MySQL, go to http://dev.mysql.com/downloads/mysql/4.0.html/. On either page, find the appropriate download for your operating system. Instructions for installation on Windows are at http://dev.mysql.com/doc/mysql/en/Windows_installation.html. For OS X, they are at http://dev.mysql.com/doc/mysql/en/Mac_OS_X_installation.html. There are also helpful OS X tips at http://www.entropy.ch/software/macosx/mysql/. For Linux, instructions are at http://dev.mysql.com/doc/mysql/en/Linux-RPM.html. Information for other Unix operating systems is at http://dev.mysql.com/doc/mysql/en/Installing_binary.html. |
< Day Day Up > |