Web Hosting Forums

Results 1 to 3 of 3

This is a discussion on How to install missing PEAR modules? in the Hosting Talk & Chit-chat forum
Hi, I need to install the following PEAR modules to run a CMS (SPIP Agora)? Where should I place the files? * Date.php * Log.php ...

  1. #1
    Loyal Client
    Join Date
    Mar 2002
    Posts
    6

    How to install missing PEAR modules?

    Hi,

    I need to install the following PEAR modules to run a CMS (SPIP Agora)? Where should I place the files?

    * Date.php
    * Log.php
    * DB/NestedSet.php
    * DB/NestedSet/DB.php
    * Mail/mime.php
    * PHP/Compat.php
    * XML/Tree/Node.php

    http://agora.gouv.fr/IMG/zip/Package...gora_1-4-x.zip

    Thanks
    Raphael

  2. #2
    the Windlord Gwaihir's Avatar
    Join Date
    Jun 2002
    Posts
    2,570
    Anywhere in the include path..

    We're talking about a shared account here? Then it's probably best to make a folder includes/PEAR right under your main folder (so /home/<accountname>/includes/PEAR) and place them there. Then add that folder to your include path (on the pages that need them or in your php.ini).
    Regards,

    Wim Heemskerk
    ---
    Visit MeCCG.net - Cardgaming in J.R.R. Tolkien's Middle-earth
    And Gwaihir.net - The Middle-earth CCG store

  3. #3
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    5,884
    You have tow options: ask support to install the packages for you or set up your own local copy of PEAR.

    I like to experiment, and lately I've been doing some experimenting with PEAR. I didn't want to have to open a support ticket every time I wanted to try a new package, so I created a local PEAR install in my account. To do this yourself you'll need SSH access, an SSH client (like PuTTY), and a little knowledge of the Unix environment. Then just follow these instructions:

    1. Create a directory to store the PEAR files. I chose to put them in a directory called "pear" in my home directory.
    Code:
    mkdir pear
    1. Run the PEAR installer from go-pear.org The PEAR site recommeds that you use the following shell command to do this:
    Code:
    lynx -source http://go-pear.org/ | php
    This downloads the installer, which is a PHP script, and runs it in one step.

    2. Read the information about the installer and press <enter>.

    3. Press <enter> when asked about an HTTP Proxy, none is required.

    4. You'll now be asked for the paths to where you want the various files installed. Assuming you want to set up your account as I did (everything in a "pear" directory, just set the Installation prefix (option 1) as follows (where USEERNAME is your account username):
    Code:
    /home/USERNAME/pear
    5. You'll be presented with a list of PEAR packages that are included with PHP and asked if you want to install them in your repository. When I did it, I chose "Yes," but it is up to you.

    6. The instyaller will begin downloading the standard packages. This could take a while.

    7. If you get an error about the pear path not being in your php.ini include_path, ignore it (we'll handle it in a minute). Press <enter> to continue.

    8. You'll be returned to the system prompt. Your local PEAR library is ready to go!

    Now, to get PHP to use your PEAR files you'll need to modify your include_path. To do this we'll need to know your current include_path. The esiest way to find this is to create a file in your public_html directory wit the following in it:
    PHP Code:
    <php phpinfo(); ?> 
    Name the file something like info.php and open it in your browser.

    2. On the PHP Info page, find the line that says "Server API" and note the value. The find the line with "include_path" and copy the value to your computer's clipboard).

    3. If in step 2 you found the Server API to be "Apache," create a file in public_html called .htaccess and add the following to it:

    [code]php_value include_path (paste the text you copied here)[/php]

    Then add the path to your PEAR directory (/home/USERNAME/pear/lib/php) to the pasted text. I chose to add it to the begining of the list, just after the ".". Each path in the list is separated by a colon, so it should look something like this when done:
    Code:
    .:/home/USERNAME/pear/lib/php:/usr/lib/php:/usr/local/lib/Smarty
    If the Server API is "CGI" then you'll need to create a custom php.ini file in your public_html. See this thread for more info about that. The format of the final value should be the same as the one shown above.

    To install new packages, type
    Code:
    ./pear/bin/pear install PACKAGE_NAME
    and they'll be installed in your local pear library.

    To make it easier for myself, I created an alias in my .profile file as follows:
    Code:
    alias mypear="/home/USERNAME/pear/bin/pear"
    Now, to install a package I don't have to remember the path to the pear manager. Instead I just type
    Code:
    mypear install PACKAGE_NAME
    I hope this helps.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •