11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

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

www.it-ebooks.infoCHAPTER 11 • PEARalso show you how to install PEAR on a hosted server so you can continue using PEAR packages onceyour website is deployed.Installing PEAR on LinuxInstalling PEAR on Linux is really easy, because, as of <strong>PHP</strong> 4.3.0, it’s installed by default unless youexplicitly disabled its installation when configuring <strong>PHP</strong> by using the --without-pear option. If you diddisable it and wanted to install it at the same time you were reconfiguring <strong>PHP</strong>, just make sure you omitincluding the --without-pear option; alternatively, you could make the desire explicit by including the -–with-pear option. Just keep in mind that if you relied upon a particular Linux distribution’s packagemanager to install <strong>PHP</strong>, then you’ll need to verify that it was installed along with <strong>PHP</strong> because thedevelopers might have opted to leave such decisions to the user.You can also install PEAR by retrieving a script from the pear.php.<strong>net</strong> web site and executing it withthe <strong>PHP</strong> binary. Open up a terminal and execute the following command:%>lynx -source http://pear.php.<strong>net</strong>/go-pear | phpNote that you need to have the Lynx Web browser installed, a rather standard program on the Unixplatform. If you don’t have it, search the appropriate program repository for your particular OSdistribution; it’s guaranteed to be there. Alternatively, you can just use a standard Web browser such asFirefox and navigate to the preceding URL, save the retrieved page, and execute it using the binary.Once the installation process begins, you’ll be prompted to confirm a few configuration settingssuch where to store the PEAR packages and documentation. You’ll likely be able to accept the defaultanswers without issue. During this round of questions, you will also be prompted as to whether the threeoptional default packages should be installed. It’s presently an all-or-none proposition; therefore, ifyou’d like to immediately begin using any of the packages, just go ahead and accede to the request.Installing PEAR on WindowsPEAR is not installed by default with the Windows distribution. To install it, you need to run the gopear.batfile, located in the <strong>PHP</strong> distribution’s root directory. This file installs the PEAR command, thenecessary support files, and the aforementioned six PEAR packages. Initiate the installation process bychanging to the <strong>PHP</strong> root directory and executing go-pear.bat, like so:%>go-pear.batYou’ll be prompted to confirm a few configuration settings such as the location of the <strong>PHP</strong> rootdirectory and executable; you’ll likely be able to accept the default answers without issue. During thisround of questions, you will also be prompted as to whether the six optional default packages should beinstalled. It’s presently an all-or-none proposition; therefore, if you’d like to immediately begin usingany of the packages, just go ahead and accede to the request.For the sake of convenience, you should also append the <strong>PHP</strong> installation directory path to the PATHenvironment variable so the PEAR command can be easily executed.At the conclusion of the installation process, a registry file named PEAR_ENV.reg is created. Executingthis file will create environment variables for a number of PEAR-specific variables. Although not critical,adding these variables to the system path affords you the convenience of executing the PEAR PackageManager from any location while at the Windows command prompt.259

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

Saved successfully!

Ooh no, something went wrong!