php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56962 pear re-install fail: go-pear script
Submitted: 2006-04-18 23:01 UTC Modified: 2006-04-29 09:04 UTC
From: pdman at aproximation dot org Assigned: pajoye (profile)
Status: Not a bug Package: PECL website (PECL)
PHP Version: 4.3.11 OS: Fedora Core 2.6.12-1.1378_FC3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
36 + 11 = ?
Subscribe to this entry?

 
 [2006-04-18 23:01 UTC] pdman at aproximation dot org
Description:
------------
I am trying to use go-pear to install the latest version of PEAR on my dedicated server, yet I get repeated fails with error messages I cannot really understand. (looks like a cvs problem perhaps?)

Test script:
---------------
lynx -source http://go-pear.org/ | php

Expected result:
----------------
I should get a bunch of download .... ok messages probably followed by a bunch of bootstrap .... ok messages, then the newest PEAR would be installed.

Actual result:
--------------
 1. Installation prefix           : /usr
 2. Binaries directory            : $prefix/bin
 3. PHP code directory ($php_dir) : $prefix/share/pear
 4. Documentation base directory  : $php_dir/docs
 5. Data base directory           : $php_dir/data
 6. Tests base directory          : $php_dir/tests
 7. Temporary files directory     : /tmp/pear/cache

1-7, 'all' or Enter to continue:

The following PEAR packages are bundled with PHP: DB, Net_Socket, Net_SMTP,
Mail, XML_Parser, PHPUnit.
Would you like to install these as well? [Y/n] : Y

Loading zlib: ok
PHP Notice:  Undefined variable:  dh in - on line 608

Notice: Undefined variable:  dh in - on line 608
Downloading package: PEAR-stable......ok
Downloading package: Archive_Tar-stable....ok
Downloading package: Console_Getopt-stable....ok
Downloading package: XML_RPC-stable....ok
Bootstrapping: PEAR...................(remote) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- ViewVC -- http://viewvc.tigris.org/
by Greg Stein -- mailto:gstein@lyra.org -->
<head>
<title>ViewVC Exception</title>
</head>
<body>
<h3>An Exception Has Occurred</h3>


<h4>Python Traceback</h4>
<p><pre>
Traceback (most recent call last):
  File "./lib/viewcvs.py", line 3591, in main
  File "./lib/viewcvs.py", line 379, in run_viewcvs
  File "./lib/viewcvs.py", line 2114, in view_checkout
  File "/usr/local/viewvc-1.0-dev/lib/vclib/bincvs/__init__.py", line 134, in openfile
    filename, revision = _parse_co_header(fp)
  File "/usr/local/viewvc-1.0-dev/lib/vclib/bincvs/__init__.py", line 549, in _parse_co_header
    raise COMalformedOutput, "Unable to find revision in co output stream"
COMalformedOutput: Unable to find revision in co output stream

</pre></p>
</body>
</html>
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
PHP Fatal error:  Undefined class name 'pear' in - on line 701

Fatal error: Undefined class name 'pear' in - on line 701

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-19 08:00 UTC] pajoye@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PEAR.


It looks like you had a connection problem. Are you using a proxy but did not specify any value for the proxy options?
 [2006-04-20 00:37 UTC] pdman at aproximation dot org
I am not using any proxy. I am ssh'd into a remote dedicated webserver that is essentially directly connected to the backbone.

I have tried installing PEAR like this on probably five occasions and each ocassion I run the go-pear | php command two to three times. Each time I get that CVS co error during pear bootstrapping (what is that BTW) and then after a few more packages donload I get the pear class not defined error.

To be clear I do not propose that this is a PHP error, but an error with the go-pear script and/or how that script reports errors. Is there a log of the scripts transactions so I can se where it is breaking - a verbose way to run the script?

I have also tried submitting mail to the php-install list (as suguested by the PEAR "how to report a bug" guide) but because I use horde and an alternate identitiy for my mailinglist email address I am having trouble there.

Thank you for any help,
-wade
 [2006-04-20 07:20 UTC] cipri@php.net
What happens is that the script tries to download the latest PEAR.php to use it to install the downloaded tarballs.
However, the PEAR.php that you download doesn't seem to work. Could you please try the following steps:
1) Download http://go-pear.org/ to a local file called go-pear.php
2) Make the following modifications:
Line 230: comment the line register_shutdown_function('bail');
Line 647: Add the following lines before the include_once 'PEAR.php' line:
print("\n");
var_dump(getcwd());
var_dump($url);
var_dump($http_proxy);
die();


3) Run ``cat go-pear.php | php''
4) Submit the debug output generated.
5) Also include the PEAR.php that was downloaded. You can find this in the directory that the debug output gave you, ie: string(15) "/tmp/gopeq8oBxB"
 [2006-04-21 02:42 UTC] pdman at aproximation dot org
Thanks for the help!

<---output---->

cat go-pear.php |  php
Content-type: text/html
X-Powered-By: PHP/4.3.11

Welcome to go-pear!

Go-pear will install the 'pear' command and all the files needed by
it.  This command is your tool for PEAR installation and maintenance.

Go-pear also lets you download and install the PEAR packages bundled
with PHP: DB, Net_Socket, Net_SMTP, Mail, XML_Parser, PHPUnit.


If you wish to abort, press Control-C now, or press Enter to continue:

HTTP proxy (http://user:password@proxy.myhost.com:port), or Enter for none::

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation prefix           : /usr
 2. Binaries directory            : $prefix/bin
 3. PHP code directory ($php_dir) : $prefix/share/pear
 4. Documentation base directory  : $php_dir/docs
 5. Data base directory           : $php_dir/data
 6. Tests base directory          : $php_dir/tests
 7. Temporary files directory     : /tmp/gope2sTcfA

1-7, 'all' or Enter to continue: 7
Temporary files directory [/tmp/gope2sTcfA] : /tmp/pear/cache

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation prefix           : /usr
 2. Binaries directory            : $prefix/bin
 3. PHP code directory ($php_dir) : $prefix/share/pear
 4. Documentation base directory  : $php_dir/docs
 5. Data base directory           : $php_dir/data
 6. Tests base directory          : $php_dir/tests
 7. Temporary files directory     : /tmp/pear/cache

1-7, 'all' or Enter to continue:

The following PEAR packages are bundled with PHP: DB, Net_Socket, Net_SMTP,
Mail, XML_Parser, PHPUnit.
Would you like to install these as well? [Y/n] : y

Loading zlib: ok
PHP Notice:  Undefined variable:  dh in - on line 609

Notice: Undefined variable:  dh in - on line 609
Downloading package: PEAR-stable......ok
Downloading package: Archive_Tar-stable....ok
Downloading package: Console_Getopt-stable....ok
Downloading package: XML_RPC-stable....ok
Bootstrapping: PEAR...................(remote)
string(15) "/tmp/gope2sTcfA"
string(79) "http://cvs.php.net/viewcvs.cgi/*checkout*/pear-core/PEAR.php?pathrev=RELEASE_st"
string(0) ""

<----PEAR.php---->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- ViewVC -- http://viewvc.tigris.org/
by Greg Stein -- mailto:gstein@lyra.org -->
<head>
<title>ViewVC Exception</title>
</head>
<body>
<h3>An Exception Has Occurred</h3>


<h4>Python Traceback</h4>
<p><pre>
Traceback (most recent call last):
  File "./lib/viewcvs.py", line 3591, in main
  File "./lib/viewcvs.py", line 379, in run_viewcvs
  File "./lib/viewcvs.py", line 2114, in view_checkout
  File "/usr/local/viewvc-1.0-dev/lib/vclib/bincvs/__init__.py", line 134, in openfile
    filename, revision = _parse_co_header(fp)
  File "/usr/local/viewvc-1.0-dev/lib/vclib/bincvs/__init__.py", line 549, in _parse_co_header
    raise COMalformedOutput, "Unable to find revision in co output stream"
COMalformedOutput: Unable to find revision in co output stream

</pre></p>
</body>
</html>

Side note: I changed the tmp directory to /tmp/pear/cache but the script looks like it is still trying to use some auto generated character string despite my preference.
I tried running lynx -source http://go-pear.org/ | php and not changing the tmp directory but it still did not work.

Can you have a '*' in a URL (the *checkout* URL)?

What next?
Thanks again for your time!
-wade
 [2006-04-21 09:16 UTC] cipri@php.net
There seems to be something wrong with the files it downloads. The * isn't a problem in the URL, the revision it tries to download is.

Can you check in the tempfolder, if the files in there are labeled PACKAGE-x.y.z.tgz, or simply PACKAGE-stable.

If they are labeled PACKAGE-stable,  please post the ./configure string used to compile PHP, as 4.3.11 does not seem to be a Fedora Core supplied version. THis information can be in the phpinfo() output.

Also, please try the following script, which contains the normal go-pear, with a lot of added debugging, to find out why the files are downloaded wrongly:

# lynx -source http://www.cipri.com/go-pear/ | php
 [2006-04-21 22:01 UTC] pdman at aproximation dot org
Alright, now I feel like we are getting somewhere! THanks!

My tmp folder just has PEAR-stable, so...

'./configure' '--build=i386-redhat-linux' '--host=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd=shared' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-ncurses=shared' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-xml' '--with-expat-dir=/usr' '--with-dom=shared,/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-xmlrpc=shared' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mbstring=shared' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mime-magic=/usr/share/file/magic.mime' '--with-pic' '--enable-force-cgi-redirect'

I think you are right actually about my php not being the Fedora Core default (despite rpm -q php returning php-4.3.11-2.8).
I think I had to rebuild php for some Horde dependancy. To do so though I used the FC3 configure string and just added the enable tags I needed.

Here is the output of your script (starting from where it seems to differ from the go-pear.org output) - I just used the tmp folder the script sugguested:

Downloading package: PEAR-stable......http://pear.php.net/get/PEAR-stable

array(4) {
  ["scheme"]=>
  string(4) "http"
  ["host"]=>
  string(12) "pear.php.net"
  ["path"]=>
  string(16) "/get/PEAR-stable"
  ["port"]=>
  int(80)
}


ok
Downloading package: Archive_Tar-stable....http://pear.php.net/get/Archive_Tar-stable

array(4) {
  ["scheme"]=>
  string(4) "http"
  ["host"]=>
  string(12) "pear.php.net"
  ["path"]=>
  string(23) "/get/Archive_Tar-stable"
  ["port"]=>
  int(80)
}


ok
Downloading package: Console_Getopt-stable....http://pear.php.net/get/Console_Getopt-stable

array(4) {
  ["scheme"]=>
  string(4) "http"
  ["host"]=>
  string(12) "pear.php.net"
  ["path"]=>
  string(26) "/get/Console_Getopt-stable"
  ["port"]=>
  int(80)
}


ok
Downloading package: XML_RPC-stable....http://pear.php.net/get/XML_RPC-stable

array(4) {
  ["scheme"]=>
  string(4) "http"
  ["host"]=>
  string(12) "pear.php.net"
  ["path"]=>
  string(19) "/get/XML_RPC-stable"
  ["port"]=>
  int(80)
}


ok
Bootstrapping: PEAR...................
array(5) {
  ["scheme"]=>
  string(4) "http"
  ["host"]=>
  string(11) "cvs.php.net"
  ["path"]=>
  string(42) "/viewcvs.cgi/*checkout*/pear-core/PEAR.php"
  ["query"]=>
  string(18) "pathrev=RELEASE_st"
  ["port"]=>
  int(80)
}
HTTP/1.1 200 OK
Date: Sat, 22 Apr 2006 01:55:59 GMT
Server: Apache/1.3.34 (Unix) PHP/5.1.3-dev
Connection: close
Content-Type: text/html; charset=iso-8859-1


(remote) string(15) "/tmp/gopeSuLEeE"
string(79) "http://cvs.php.net/viewcvs.cgi/*checkout*/pear-core/PEAR.php?pathrev=RELEASE_st"
string(0) ""
 [2006-04-21 22:39 UTC] pajoye@php.net
Please try the latest version:

You can fetch it from:
http://cvs.php.net/viewcvs.cgi/*checkout*/pearweb/public_html/go-pear?rev=1.86

or 
http://cvs.php.net/viewcvs.cgi/pearweb/public_html/go-pear?view=log (Click download)

or wait 1-2hours until go-pear.org is updated.
 [2006-04-21 23:38 UTC] pdman at aproximation dot org
It got further! Now it bootstraps but still fails. Does my version of PHP not have an uncompression utility? Is that perhaps why it fails at extraction?

lynx -source http://cvs.php.net/viewcvs.cgi/*checkout*/pearweb/public_html/go-pear?rev=1.86 | php
Content-type: text/html
X-Powered-By: PHP/4.3.11

Welcome to go-pear!

Go-pear will install the 'pear' command and all the files needed by
it.  This command is your tool for PEAR installation and maintenance.

Go-pear also lets you download and install the PEAR packages bundled
with PHP: DB, Net_Socket, Net_SMTP, Mail, XML_Parser, PHPUnit.


If you wish to abort, press Control-C now, or press Enter to continue:

HTTP proxy (http://user:password@proxy.myhost.com:port), or Enter for none::

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation prefix           : /usr
 2. Binaries directory            : $prefix/bin
 3. PHP code directory ($php_dir) : $prefix/share/pear
 4. Documentation base directory  : $php_dir/docs
 5. Data base directory           : $php_dir/data
 6. Tests base directory          : $php_dir/tests
 7. Temporary files directory     : /tmp/gopeelyZvu

1-7, 'all' or Enter to continue:

The following PEAR packages are bundled with PHP: DB, Net_Socket, Net_SMTP,
Mail, XML_Parser, PHPUnit.
Would you like to install these as well? [Y/n] : y

Loading zlib: ok
Downloading package: PEAR-stable......ok
Downloading package: Archive_Tar-stable....ok
Downloading package: Console_Getopt-stable....ok
Downloading package: XML_RPC-stable....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..................<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- ViewVC -- http://viewvc.tigris.org/
by Greg Stein -- mailto:gstein@lyra.org -->
<head>
<title>ViewVC Exception</title>
</head>
<body>
<h3>An Exception Has Occurred</h3>


<h4>Python Traceback</h4>
<p><pre>
Traceback (most recent call last):
  File "./lib/viewcvs.py", line 3591, in main
  File "./lib/viewcvs.py", line 379, in run_viewcvs
  File "./lib/viewcvs.py", line 2114, in view_checkout
  File "/usr/local/viewvc-1.0-dev/lib/vclib/bincvs/__init__.py", line 134, in openfile
    filename, revision = _parse_co_header(fp)
  File "/usr/local/viewvc-1.0-dev/lib/vclib/bincvs/__init__.py", line 549, in _parse_co_header
    raise COMalformedOutput, "Unable to find revision in co output stream"
COMalformedOutput: Unable to find revision in co output stream

</pre></p>
</body>
</html>
PHP Fatal error:  Cannot instantiate non-existent class:  archive_tar in - on line 721

Fatal error: Cannot instantiate non-existent class:  archive_tar in - on line 721
 [2006-04-22 10:06 UTC] pajoye@php.net
4.3.11 works well with go-pear.

But there is another problem, is it possible to give me an access to your system? Mail me privatelly. It would be faster than try&fail here.
 [2006-04-24 22:03 UTC] pdman at aproximation dot org
Pierre, I sent you an ssh login and password, did you get it?
Can you log in? Do you have the permissions you need?
I am afraid that your spam filter has eaten my email...
Thanks,
-wade
 [2006-04-26 12:59 UTC] pajoye@php.net
I did not get it. Which email did you use? @php.net requires confirmations. Please send it again to pierre.php[at]gmail.com
 [2006-04-28 00:39 UTC] pdman at aproximation dot org
In case the reader of this bug (not you Pierre, you already know what is going on :^) ) is having the same problem, Pierre has discovered that wget http://pear.php.net/get/pear-stable on my machine is hanging for some reason (despite wget http://pear.php.net/ working just fine).

I am trying to get to the bottom of this problem and I have started a forum thread here at linuxforums.org:
http://www.linuxforums.org/forum/linux-networking/59491-weird-pear-wget-update-problem-possibly-iptables.html#post320590

Thanks again Pierre,
-wade
 [2006-04-28 07:28 UTC] pajoye@php.net
It was not only wget (we do not use wget), but nearly all sockets operations, incl. from php.
 [2006-04-28 23:09 UTC] pdman at aproximation dot org
But it doesn't seem like a server error or firewall problem on my side if I can connect to any URL using any tool from my server, with the single exception of the http://pear.php.net/get/pear-stable URL.

What I am guessing is the problem is that I am connecting to the 'pear-stable' script and it is just hanging waiting for an additional piece of information.

Is there any data that pear-stable is reading from the $_SERVER variable for example that I am not supplying it perhaps? (that I could put in my .wgetrc file)?
 [2006-04-29 09:04 UTC] pajoye@php.net
No, it is a handle by a php script. Again, wget was only a test to see what's wrong on your host. We do not use wget in gopear but php streams.

You can try to load this url from your browser, you will see that it perfectly works.

Sorry, I'm closing this bug now. If you have solved your network problems and still have problems with the installation (bugs), reopen it.
 [2006-04-29 09:04 UTC] pajoye@php.net
Sorry, but your problem does not imply a bug in PEAR itself.  For a
list of more appropriate places to ask for help using PEAR, please
visit http://pear.php.net/support/ as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PEAR.

> bogus
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 14:01:28 2024 UTC