Chapter 2: Installation This chapter provides step-by-step instructions
Chapter 2: Installation This chapter provides step-by-step instructions for installing and configuring PHP on UNIX-like systems, Windows, and MacOS systems. Additional instructions for installing Apache and MySQL are provided. We also include some suggestions for what to do “in the unlikely event” something goes wrong. I Already Have PHP If you already have PHP on your web server, you’ll still need to verify that your installation of PHP is configured with all the tools you’ll need for this blog. Fortunately, there is a built in PHP function, called phpinfo(), to provide status output of virtually everything configurable. If you have a web server, simply create a text file just like you would an HTML file, but put only one line in it: You do not need any HTML tags. The phpinfo() function will output everything needed. If your fancy HTML-editor insisted on adding and
tags and you can’t get rid of them, most browsers will probably cope with it. Save the file as phpinfo.php and verify that the filename is correct. Notepad tends to add .txt to the end of filenames whether you want it to or not: phpinfo.php.txt will not work. EditPlus from http://www.editplus.com/ is a great alternative to Notepad, but there are dozens of others. Upload phpinfo.php to your web server. Surf to http://localhost/phpinfo.php and you’ll get a long page of all the features installed with PHP. Sample output of phpinfo() is provided later in this chapter, but there are only a few possible outcomes here: . A long page of pretty blue and grey boxes filled with various resources available with PHP . Nothing displayed in the browser, but the browser’s View Source menu item shows the phpinfo.php script . Error 404: Page Missing (or similar) . Error 500: Internal Server Error (or similar) In case 1, you have PHP, and you can simply read on. In case 2, you either didn’t use .php for the file extension, or your web server is not configured with PHP. In case 3, you either uploaded the file to the wrong place, or didn’t name it phpinfo.php or didn’t surf to the correct URL or similar. Check the URL, the filename, and the upload directory. In case 4, PHP was probably installed, but incorrectly, and the web server is crashing. Read the remainder of this chapter for suggestions on how to track down what is going on. Once you see the pretty blue and grey boxes, you know you have PHP running, but you need to ensure that the following are somewhere in the text: . PHP version 4.0.5 or higher The closer to the current version at http://php.net/downloads.php, the better . MySQL version 3.23.xx or higher Current version listed at http://www.mysql.com/ You may want to use the browser’s Find menu item to search for keywords. If a keyword is truly missing (check your spelling) then it is not installed. You may be able to work around one or two of these features if they are missing or if the version number is a little older than required. However, if your software is way out of date, or is missing multiple features required, you’ll need to upgrade. Also, it may be easier and less time consuming to find an ISP that supports PHP and MySQL than it is Page 24Note: If you are looking for high quality webhost to host and run your jsp application check Vision jsp hosting services