PEAR Articles
  Home arrow PEAR Articles arrow Page 2 - The PEAR Package Tour: PEAR Basics
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PEAR ARTICLES

The PEAR Package Tour: PEAR Basics
By: Chris Moyer
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2008-07-09

    Table of Contents:
  • The PEAR Package Tour: PEAR Basics
  • Installing PEAR Modules
  • Installing Packages
  • Core PEAR Classes
  • A Selection of PEAR Packages

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    The PEAR Package Tour: PEAR Basics - Installing PEAR Modules


    (Page 2 of 5 )

    Base Installer

    To start off with PEAR, you need to have the basic PEAR installation on your system. With a modern version of PHP, those after 4.3.0, PEAR comes with PHP unless it is explicitly excluded at compile time with the --without-pear flag.

    On a Windows system, you may have to complete an additional step after PHP is installed. You’ll need to add the location of the PEAR installer to your command path. This is most easily accomplished by double clicking PEAR_ENV.reg in your PHP installation directory. This is a small registry entry that will add PEAR to your path. You can verify this step by opening the command-line and attempting to run the PEAR installer:


    C:> pear

    Commands

    build Builds an Extension from C source

    bundle Unpacks a Pecl Package

    channel-add Add a channel


    You should get a list of commands for the installer, and not an error telling you that “pear” is not a recognized internal or external command.

    On Linux or Mac OSX, pear should be installed and ready to go. You may want to update your PEAR system. You can determine what version you have installed with:


    > pear version

    PEAR Version: 1.4.3

     …


    If your version is outdated, download and run the updater http://pear.php.net/go-pear. Just save it as go-pear.php and then run it with the PHP command line.


    > php go-pear.php

    You will be prompted to answer some questions, and in most cases, the defaults will work fine.

    If you are on a shared host, where you do not have command line access, you can copy go-pear.php into a web accessible directory and load it in your browser. A web-based installer will guide you through installing a copy of PEAR for use in your personal web space.

    Finally, you’ll need to ensure that the PEAR directories are in your PHP include path. First, find out what path PEAR is configured to use.


    > pear config-get php_dir

    /usr/share/php

    Now, check your PHP include path. A simple way to do this is to create a .php file in your web directories and include the phpinfo() command:

    <?php

    phpinfo();

    ?>

    When loaded in a browser, this will display all sorts of useful information about your PHP set-up. Search for the include_path variable in the Configuration section, and verify that the PEAR directory is included.

    If this is not the case, you’ll need to edit your php.ini file. In the same phpinfo() output, there is a “Loaded Configuration File” variable near the top. You’ll want to edit this file and add your PEAR directory to the include_path. The result should look something like this:


    include_path = ".:/usr/share/php"

    If you modify php.ini, you’ll need to restart the web server.

    More PEAR Articles Articles
    More By Chris Moyer


       · Thanks for reading my PEAR article. This is the first of a series, with others...
     

    PEAR ARTICLES ARTICLES

    - Deleting Authors from a PEAR Content Managem...
    - PEAR CMS: Index and Delete Scripts
    - Listing Articles for a PEAR Content Manageme...
    - Building an Authors Page for a PEAR CMS
    - Building the View Details Page in a PEAR CMS
    - Creating the Main Pages of a PEAR CMS
    - Completing the Login Script for a PEAR CMS
    - User Authentication for a PEAR CMS
    - A PEAR CMS: Examining the Code
    - Building a Content Management System with PE...
    - Installing a PEAR Package
    - My PEAR: The Beginning
    - Using XML_RPC2 with PEAR
    - Using Web Service APIs (Amazon and Yahoo!) w...
    - Database Abstraction with MDB2 from PEAR





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    Stay green...Green IT