Categorized | News

Getting Up and Running with the PEAR Web Installer

Posted on 01 December 2002 by Demian Turner

For anyone who’s using classes from the PEAR repository (and especially those who are not), the whole process of getting the latest classes and browsing the collection has now been simplified with the PEAR WebInstaller.  This article sets out to describe the installation process, mainly for readers who aren’t aware of the rich library of functionality available.

Prerequisites

  • windows – The installation process will be described for  windows-based users, obviously Linux users have access to the same features and probably don’t need the tutorial 😉
  • PHP 4.2.3 – I’ve tried this with 4.1.2 and it didn’t work so I would recommend installing the latest version of PHP which can be downloaded from php.net and is very easy to configure
  • a local webserver – I use apache but any webserver will do
Bookmark and Share

18 Comments For This Post

  1. Anonymous Says:

    Hello,

     
    Regarding the article:
    Getting Up and Running with the PEAR Web Installer
     
    I just upgraded to PHP 4.3.0 (Windows distribution, Zip package, 5,811Kb),
    and then tried the instructions on the page above.
     
    When I try running the script:
     
     
    the page just hangs… and nothing appears after the paragraph that ends with:
     
      “If you wish to abort, press Control-C now,
       or press Enter to continue:”
     
       (yes… I pressed “Enter”…  and the PHP error.log file is empty?)
     
     
    I’m aware of a couple of things that are different with the new Windows
    distribution of PHP 4.3.0 (from PHP 4.2.3):
     
    1) The ZLIB extension is now built-in in the Windows distribution.
         External extension (php_zlib.dll) has been removed.
         (see changelog: http://www.php.net/ChangeLog-4.php)
     
       I’m wondering if this is causing problems within the
       “go-pear.php” script?
    (see lines 234 to 247 of “go-pear.php”).
     
    2) There was a subdirectory called “pear” in the PHP 4.2.3 distribution.
        This directory does NOT exist in PHP 4.3.0  ??
        This isn’t mentioned in the changelog..????
     
    Would either of these be causing the problem I’m having?
     
    If so, any suggestions on what I can do to get this working
    with PHP 4.3.0 ?  (ie.  go-pear.php script changes etc.)
     
    Thanks in advance…
     
    Cheers,
     
    Steve
  2. Anonymous Says:

    Hi Steve,

    regarding your probs with 4.3.0, I haven’t installed this myself yet!  But if you browse the pear mailing lists

    http://news.php.net/group.php?group=php.pear.general
    http://news.php.net/group.php?group=php.pear.dev

    you’ll see you’re not the only one.  Hopefully there are some clues here :-)

  3. demian Says:

    This PEAR primer has some great ideas for using PEAR classes in a coherent application framework:

    http://www.phpbuilder.com/columns/stump20021223.php3?page=2&print_mode=1

  4. pnllan Says:

    Great Article…

    I was having trouble getting PEAR to install properly until I came across this article. The PEAR installation documentation was lacking at best.

    Thanks!!!

  5. pnllan Says:

    HELP!

    After installing ZEND Studio, PEAR doesn’t seem to be working correctly.

    Example: Get a PAGE NOT FOUND when attempting to go to http://localhost/PEAR/PEAR/WebInstaller.php

    (YES- the file is there).

    System Info:
    Apache 2.0.48
    PHP 4.3.4
    Zend Studio 3.0.1 Plus (Server and IDE)

  6. Ragnar Says:

    I am having some problems getting Pear up and running.

    I have the go-pear.php file in a go-pear folder on my web server address. Directory is such as D:\\web sites\\name of current site\\go-pear

    PHP is installed at C:\\php

    I execute go-pear.php and I get the page to start the set up. Above it all is this warning Warning: session_destroy(): Session object destruction failed in \"D:\\web sites\\current site\\go-pear\\go-pear.php on line 235\"

    But I go ahead and select next it has the screen to select my paths for install. Here are my settings that it autofilled:
    1. Installation prefix D:\\web sites\\A-3-10-04\\go-pear
    2. Binaries directory $prefix
    3. PHP code directory ($php_dir) $prefix/PEAR
    4. Documentation base directory $php_dir\\docs
    5. Data base directory $php_dir\\data
    6. Tests base directory $php_dir\\tests
    7. PEAR Installer cache directory $php_dir/cache
    8. Cache TimeToLive 300
    9. Filename of WebFrontend $prefix/index.php
    10. php.exe path, optional (CLI command tools) c:/php/cli/php.exe

    Now on this page the warning about the session is now gone but there are 2 more at the bottom. \"Warning: Unknown(): open(C:\\data\\server\\PHP\\sessiondata\\sess_7305e954dee6a63b06fe9aae82d80ac7, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

    Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:\\data\\server\\PHP\\sessiondata) in Unknown on line 0\"

    I press install and it runs through fine up until 70% and then it just hangs and goes no where. Those 2 warnings are still on the bottom of the page and here is the rest of info from it.

    Installation in progress …
    First bar is at 70 %

    Second bar is at 100 % Downloading PHPUnit-1.0.1.tgz …

    Starting installation …
    mkdir failed: /C:
    Loading zlib: ok
    Downloading package: PEAR………….ok
    Downloading package: Archive_Tar……ok
    Downloading package: Console_Getopt….ok
    Downloading package: XML_RPC……….ok
    Downloading package: Pager…………ok
    Downloading package: HTML_Template_IT….ok
    Downloading package: Net_UserAgent_Detect….ok
    Downloading package: PEAR_Frontend_Web….ok
    Bootstrapping: PEAR……………….(remote) ok
    Bootstrapping: Archive_Tar…………(remote) ok
    Bootstrapping: Console_Getopt………(remote) ok
    Downloading package: DB……………ok
    Downloading package: Net_Socket…….ok
    Downloading package: Net_SMTP………ok
    Downloading package: Mail………….ok
    Downloading package: XML_Parser…….ok
    Downloading package: PHPUnit……….ok
    Extracting installer………………
    Warning: main(PEAR.php): failed to open stream: No such file or directory in D:\\web sites\\A-3-10-04\\go-pear\\Archive\\Tar.php on line 21

    Fatal error: main(): Failed opening required \’PEAR.php\’ (include_path=\’/C:\\WINNT\\TEMP\\gop7CF.tmp\’) in D:\\web sites\\A-3-10-04\\go-pear\\Archive\\Tar.php on line 21

    Warning: Unknown(): open(C:\\data\\server\\PHP\\sessiondata\\sess_7305e954dee6a63b06fe9aae82d80ac7, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

    Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:\\data\\server\\PHP\\sessiondata) in Unknown on line 0

    What is going on? Why will it not work? I have tried a few things but not work. Thanks for your help!

  7. demian Says:

    Sounds like the main problem is you\’ve customised where you want session data stored, and the program is not finding this location. As a foolproof approach, you could remove your customised settings in php.ini for session.save_path, and just create an empty folder c:\\tmp, even another at d:\\tmp if problems persist.

    The second problem is that your include path does not point to the PEAR libs, so edit your php.ini file and set include_path = c:\\where\\your\\pear\\libs\\are.

    If your still stuck I recommend you forward your request to the pear-general mailing list, they get lots of questions like this.

    cheers

    demian

  8. Ragnar Says:

    Ok changing where the session data was fixed it all. Actually it wasn\’t changed, the folder c:/data/server/php/sessiondata purely did not exsist, I create that folder structure where php.ini pointed to and it fixed it. Thanks for the help!

  9. leegold2 Says:

    Well, I go as far as this, following the tutorial in PHPkitchen. But the install hangs at the point cited below. I have to ask – what’s the deal here!?? why the hanging on install? Been very tough to get support from the PEAR community, is this a bug?. Using win2k and Mozilla 1.8a. Please help.

    Starting installation …
    mkdir failed: /C:
    Loading zlib: ok
    Downloading package: PEAR………….ok
    Downloading package: Archive_Tar……ok
    Downloading package: Console_Getopt….ok
    Downloading package: XML_RPC……….ok
    Downloading package: Pager…………ok
    Downloading package: HTML_Template_IT….ok
    Downloading package: Net_UserAgent_Detect….ok
    Downloading package: PEAR_Frontend_Web….ok
    Bootstrapping: PEAR……………….(remote) ok
    Bootstrapping: Archive_Tar…………(remote) ok
    Bootstrapping: Console_Getopt………(remote) ok
    Downloading package: DB……………ok
    Downloading package: Net_Socket…….ok
    Downloading package: Net_SMTP………ok
    Downloading package: Mail………….ok
    Downloading package: XML_Parser…….ok
    Downloading package: PHPUnit……….ok
    Extracting installer………………

    and PEAR hangs indefinitely

  10. demian Says:

    Lee’s problem was solved by double-clicking the go-pear.bat file. He arrived at the above problem by executing the script in a DOS shell.

  11. biot023 Says:

    Hallo — when I run the installer, this is the output I get:

    Starting installation …
    Loading zlib: ok
    Downloading package: PEAR………….ok
    Downloading package: Archive_Tar……ok
    Downloading package: Console_Getopt….ok
    Downloading package: XML_RPC……….ok
    Downloading package: Pager…………ok
    Downloading package: HTML_Template_IT….ok
    Downloading package: Net_UserAgent_Detect….ok
    Downloading package: PEAR_Frontend_Web….ok
    Bootstrapping: PEAR……………….(remote) ok
    Bootstrapping: Archive_Tar…………(remote) ok
    Bootstrapping: Console_Getopt………(remote) ok
    Downloading package: DB……………ok
    Downloading package: Net_Socket…….ok
    Downloading package: Net_SMTP………ok
    Downloading package: Mail………….ok
    Downloading package: XML_Parser…….ok
    Downloading package: PHPUnit……….ok
    Extracting installer………………ok
    Fatal error: Call to undefined method PEAR::staticpusherrorhandling() in C:WINDOWSTempgop20.tmpPEARDownloader.php on line 258

    Then, obviously, it does nothing more.
    What can I do about this?
    doug.

  12. demian Says:

    Hi Doug, I know Greg, the PEAR package mgr developer, has been doing a lot of work on this lately, best is to send your request direct to the pear-general mailing list, you can get more info at pear.php.net

    cheers

    demian

  13. Asher Wolfstein Says:

    When your PEAR installation appears to hang, or your package installations appear to hang, you may have a problem in your _jumpBlock method of Archive/Tar.php. I have provided a manual solution to this problem.

    If one can’t use
    go-pear.phar for any reason I have provided an alternative manual fix
    for this problem http://www.asherwolf.com/projects/php/pear/index.html.

    You can direct questions about this possible fix to me at asher AT
    asherwolf DOT com.

  14. Adam Says:

    What the hell? This isn’t a tutorial; it’s a damned pre-requisites spec, and that’s nothing I can’t find on the blasted PEAR website.

  15. Demian Turner Says:

    @Adam – apologies, seems like the original article got lost when I converted to WordPress – please see this Sitepoint article for comprehensive coverage of the subject: http://www.sitepoint.com/article/getting-started-with-pear/

  16. Spanish Says:

    How cojones can I install it?

  17. Demian Turner Says:

    download this file, and follow instructions at top:

    http://pear.php.net/go-pear

  18. Spanish Says:

    Thanks, but still doesn’t work

1 Trackbacks For This Post

  1. PEAR tutorials | PHP kitchen Says:

    […] http://www.phpkitchen.com […]

Leave a Reply

Categories

Books

Demian Turner's currently-reading book recommendations, reviews, favorite quotes, book clubs, book trivia, book lists

Facebook