PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » PEAR » PEAR » Bug #5906

Upgrading PEAR package removes pear command

Details

Submitted2005-11-09 16:07 UTC
Fromjklawite at sierra-bravo dot com
Assignedpajoye
StatusBogus
PackagePEAR
PHP Version4.3.2
OSRed Hat Enterprise Linux 3
Roadmaps(Not assigned)

Comments

[2005-11-09 16:07 UTC] jklawite at sierra-bravo dot com

Description:
------------
Trying to update to PEAR 1.4.4 this morning I ran

[xxx@WNSgateway xxx]#pear upgrade PEAR
downloading PEAR-1.4.4.tgz ...
...done: 276,978 bytes
upgrade ok: PEAR 1.4.4
[xxx@WNSgateway xxx]# pear list-all
-bash: /usr/bin/pear: No such file or directory

I searched the system and could not find any trace of the files included in the scripts folder of the PEAR-1.4.4 package.

I then downloaded PEAR-1.4.4.tgz, unpacked it and tried to move the files in the scripts folder into their proper places. Now when I run any pear command I get this error

Fatal error: Call to undefined function: getopt2() in /usr/share/pear/System.php on line 78

Expected result:
----------------
Pear to upgrade and still have the "pear" command available to use

Actual result:
--------------
-bash: /usr/bin/pear: No such file or directory

[2005-11-11 17:37 UTC] normelton at gmail dot com

I can confirm that I lost my pear command after attempting to
upgrade to 1.4.4 on two separate boxes. Both exhibited
identical behavior.

See bug #5939 (dup of this) for details.

Norman

[2005-12-06 12:08 UTC] richardbirch at albumsnaps dot com

I've recently experienced this behaviour too.

I upgraded pear on two redhat servers to version 1.4.5 after reading about the upgrade available that fixes a vulnerability in versions below 1.4.3. I think the version I upgraded from was around 1.3

However, after the upgrade the /usr/bin/pear script disappeared. I upgraded the only way I know how by issuing the;

# pear upgrade PEAR

command. I tried the upgrade on a gentoo server too and it seemed to work fine so I guess it's an issue with redhat?

I've tried copying the /usr/bin/pear script from my gentoo server (and changed the paths to /usr/share/pear) but I get no output when typing eg.

# pear list

Typing 'pear' gives me the list of options, but I can't us any of them.

Any idea how to fix this?

BTW I also tried typing 'locate peardev' but this produces no output at all

[2006-01-31 18:24 UTC] nefertitian at gmail dot com

have the same problem. installed pear from the SLES 9 CD sets. then upgraded pear. and then onwards, for every command that I type, i get the missing 'getopt2' function call.

[2006-10-25 14:47 UTC] ashnazg at users dot sourceforge dot net

I just had to deal with this problem, so since I found very little online to help me figure it out, I thought I'd update this thread in the hopes it helps the next person...

I had this problem, getting "Call to undefined function: getopt2()" in PEAR 1.4.11 (the current stable version as of today). What I discovered was that my PATH was set such that my personal installation of PEAR was NOT the one being run by my shell... my PATH was finding a system-wide PEAR installation and running it instead. It wasn't enough for me to force my local pear command to run (">./pear help")... I had to set my PATH to have my pear's bin directory ahead of the other system paths.

I believe running my personal copy ("./pear") without my local pear bin being in my PATH, the other pear-related stuff that "./pear" tried to run was attempting to use the PEAR stuff it found in the system-wide installation. Since my system-wide installation is much older than my personal one, the discrepancy between what it expected to find in Getopts.php and what was in the system-wide version of it should not be a surprise.

Once I added "PATH=~/my_pear_installation_dir/bin:$PATH", everything started working.