The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Pear somewhat broken with PHP 5.2.1

Discussion in 'General Discussion' started by hostmoon, May 9, 2007.

  1. hostmoon

    hostmoon Well-Known Member

    Joined:
    Aug 4, 2004
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    I recently did an upgrade to PHP 5.2.1 and realized a few days ago that Pear is broken. When trying to install a new pear module I get issues like this:

    pear install HTTP_Request
    WARNING: "pear/Net_URL" is deprecated in favor of "pear/Net_URL2"
    downloading HTTP_Request-1.4.0.tgz ...
    Starting to download HTTP_Request-1.4.0.tgz (15,262 bytes)
    .....done: 15,262 bytes
    Could not get contents of package "/tmp/pear/cache/HTTP_Request-1.4.0.tgz". Invalid tgz file.
    Download of "pear/HTTP_Request" succeeded, but it is not a valid package archive
    Error: cannot download "pear/HTTP_Request"
    downloading Net_URL-1.0.14.tgz ...
    Starting to download Net_URL-1.0.14.tgz (5,173 bytes)
    ...done: 5,173 bytes

    Warning: PEAR_Downloader::require_once(Structures/Graph.php): failed to open stream: No such file or directory in PEAR/Downloader.php on line 1194

    Warning: PEAR_Downloader::require_once(Structures/Graph.php): failed to open stream: No such file or directory in /usr/local/lib/php/PEAR/Downloader.php on line 1194

    Fatal error: PEAR_Downloader::require_once(): Failed opening required 'Structures/Graph.php' (include_path='/usr/local/lib/php') in /usr/local/lib/php/PEAR/Downloader.php on line 1194


    Any ideas how to deal with this? Should I try installing pear manually? Help.

    thanks,
    dale
     
  2. hostmoon

    hostmoon Well-Known Member

    Joined:
    Aug 4, 2004
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    I'm still looking around for a solution here. I have done all the usual upcp/easyapache etc etc but I still am getting the "Invalid tgz file." message and cannot install any pear packages. Hep.

    thanks,
    dale
     
  3. AlanH

    AlanH Active Member

    Joined:
    Mar 25, 2006
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    I know this is an old post but I encountered this problem today on WHM 11.15.0 cPanel 11.18.5-R23897.

    The fix is to track down the /usr/local/lib/php/Archive/Tar.php and/or /usr/lib/php/Archive/Tar.php files and change the following removing the line marked '-' and adding the lines marked '+'...

    Code:
        function listContent()
        {
            $v_list_detail = array();
    
            if ($this->_openRead()) {
    +            $r = $this->_extractList('', $v_list_detail, "list", '', '');
    +            if (!$r) {
    -           if (!$this->_extractList('', $v_list_detail, "list", '', '')) {
                    unset($v_list_detail);
                    $v_list_detail = 0;
                }
                $this->_close();
            }
    
            return $v_list_detail;
        }
    
    
    
     
  4. AlanH

    AlanH Active Member

    Joined:
    Mar 25, 2006
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    Really glad I made that post. Had the same error again today on another installation and found the old fix worked fine :)
     
  5. boeingb17

    boeingb17 Registered

    Joined:
    May 28, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Alan,

    I owe you a big one! This problem has plagued me for months and your fix worked perfectly!

    I'm surprised this hasn't gotten more attention, but it sure saved my hide.
     
  6. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    It's a bit outdated now though and you could just upgrade PHP ;)
     
  7. AlanH

    AlanH Active Member

    Joined:
    Mar 25, 2006
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    I think you'll find that this is a PEAR problem, not a PHP problem. That means it's PHP release independent so you could try upgrading PHP as you've suggested, but it wouldn't help much ;)
     
Loading...

Share This Page