13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Installing Apache, <strong>PHP</strong>, <strong>and</strong> <strong>MySQL</strong> Under Windows<br />

905<br />

or<br />

http://your-ip-number-here/test.php<br />

If you see a page similar to the one shown in Figure A.2, you know that <strong>PHP</strong> is working.<br />

Installing PEAR<br />

<strong>PHP</strong>5 comes with the <strong>PHP</strong> Extension <strong>and</strong> Application Repository (PEAR) package<br />

installer. If you are using Windows, go to the comm<strong>and</strong> line <strong>and</strong> type<br />

c:\php\go-pear<br />

The go-pear script asks you a few straightforward questions about where you would<br />

like the package installer <strong>and</strong> the st<strong>and</strong>ard PEAR classes installed <strong>and</strong> then downloads<br />

<strong>and</strong> installs them for you. (This first step is not required under Linux, but the rest of the<br />

installation is the same.)<br />

At this stage, you should have an installed version of the PEAR package installer <strong>and</strong><br />

the basic PEAR libraries.You can then simply install packages by typing<br />

pear install package<br />

where package is the name of the package you want to install.<br />

To get a list of available packages, type<br />

pear list-all<br />

To see what you have installed currently, try<br />

pear list<br />

To install the MIME mail package used in Chapter 30,“Building a Mailing List<br />

Manager,” type<br />

pear install Mail_Mime<br />

The DB package mentioned in Chapter 11,“Accessing Your <strong>MySQL</strong> Database from the<br />

<strong>Web</strong> with <strong>PHP</strong>,” must also be installed in the same way:<br />

pear install MDB2<br />

If you want to check for newer versions of any installed packages, use<br />

pear upgrade pkgname<br />

If the preceding procedure does not work for you for whatever reason, we suggest you<br />

try downloading PEAR packages directly.To do this, go to http://pear.php.net/<br />

packages.php.<br />

From here you can navigate through the various packages available. For example, in<br />

this book, we use Mail_Mime. Click through to the page for this package <strong>and</strong> click<br />

Download Latest to get a copy.You need to unzip the file you have downloaded <strong>and</strong> put<br />

it somewhere in your include_path.You should have a c:\php\pear or similar directory.<br />

If you are downloading packages manually, we suggest you put the packages in the

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!