Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 95931 - dev-php/php-5.1.0_beta cannot find 'pear' command, when I install any PEAR-packages.
Summary: dev-php/php-5.1.0_beta cannot find 'pear' command, when I install any PEAR-pa...
Status: RESOLVED LATER
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
: 96941 (view as bug list)
Depends on:
Blocks: 60438 95912
  Show dependency tree
 
Reported: 2005-06-12 23:49 UTC by Roman Karshiev
Modified: 2005-07-05 13:36 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Karshiev 2005-06-12 23:49:07 UTC
After upgrade to PHP5, i have lost pear.

Reproducible: Always
Steps to Reproduce:
1. emerge -pv php PEAR-PEAR
2. emerge php PEAR-PEAR
Actual Results:  
1:

# emerge -pv php PEAR-PEAR

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] dev-php/php-5.1.0_beta  -adabas -bcmath +berkdb -birdstep +bzip2 
-calendar -cdb +crypt -ctype +curl -curlwrappers -db2 +dba -dbase -dbm -dbmaker 
-dbx -debug -empress -empress-bcs -esoob +exif -fdftk -filepro -flatfile -
frontbase +ftp +gd -gd-external +gdbm -gmp -hardenedphp -hyperwave-api +iconv 
+imap -informix -inifile -interbase -iodbc +jpeg -kerberos +ldap -libedit -mcve 
-memlimit -mhash -mime -ming -mkconfig -msession -msql -mssql +mysql -mysqli 
+ncurses +nls -oci8 -odbc -oracle7 -ovrimos -pcntl +pcre -pfpro +png -posix 
+postgres -qdbm +readline -recode -sapdb +sasl +session -sharedext -sharedmem -
simplexml -snmp -soap -sockets -solid +spell -spl +sqlite +ssl -sybase -sybase-
ct -sysvipc +threads -tidy +tiff -tokenizer +truetype -wddx +xml2 -xmlrpc -xpm -
xsl +zlib 0 kB
[ebuild  N    ] dev-php/PEAR-XML_RPC-1.1.0  0 kB
[ebuild  N    ] dev-php/PEAR-Archive_Tar-1.3.1  14 kB
[ebuild  N    ] dev-php/PEAR-Console_Getopt-1.2  3 kB
[ebuild  N    ] dev-php/PEAR-PEAR-1.3.5  105 kB

Total size of downloads: 123 kB

2: ...
...

10:37:59 (26.50 KB/s) - `XML_RPC-1.1.0.tgz' saved [12,596/12,596]

>>> md5 files   ;-) PEAR-XML_RPC-1.1.0.ebuild
>>> md5 files   ;-) PEAR-XML_RPC-1.2.2.ebuild
>>> md5 files   ;-) ChangeLog
>>> md5 files   ;-) metadata.xml
>>> md5 files   ;-) files/digest-PEAR-XML_RPC-1.1.0
>>> md5 files   ;-) files/digest-PEAR-XML_RPC-1.2.2
>>> md5 src_uri ;-) XML_RPC-1.1.0.tgz
>>> Unpacking source...
>>> Unpacking XML_RPC-1.1.0.tgz to /var/tmp/portage/PEAR-XML_RPC-1.1.0/work
tar: Нулевой блок в 102
>>> Source unpacked.
>>> Test phase [not enabled]: dev-php/PEAR-XML_RPC-1.1.0

>>> Install PEAR-XML_RPC-1.1.0 into /var/tmp/portage/PEAR-XML_RPC-1.1.0/image/ 
category dev-php
/usr/portage/eclass/php-pear.eclass: line 49: pear: command not found

!!! ERROR: dev-php/PEAR-XML_RPC-1.1.0 failed.
!!! Function php-pear_src_install, Line 49, Exitcode 127
!!! (no error message)
!!! If you need support, post the topmost build error, NOT this status message.


Expected Results:  
successfully install PEAR.
Comment 1 Markus Tacker 2005-06-14 00:52:57 UTC
I can confirm that.
The latest working release for me was 5.0.3, which has been pulled from portage.
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2005-06-14 07:26:23 UTC
Next time, would someone please be so kind and double-check (or perhaps rather
triple-check) that the eclass you are committing is the one you have tested?
Third consecutive PHP fsck-up (5.0.4, 5.0.4-r1, 5.1.0_beta). Well done. :-(
Comment 3 Justin Jones 2005-06-14 16:12:03 UTC
I've gone back to PHP4 now. So ridiculous :/
Comment 4 Markus Tacker 2005-06-15 03:11:30 UTC
Comon guys, don't be like that.
Of course I'd like to see stable PHP5 releases but the are still _hard masked_
so they're just intended for _testing_.
Comment 5 Jory A. Pratt 2005-06-19 20:17:27 UTC
you can always grab 5.0.3 from viewcvs.gentoo.org and throw it into an overlay
no need for all the whinning robbat2 will rework that package soon as he has
time I would imagine.
Comment 6 Ian P. Christian 2005-06-22 05:58:22 UTC
I confirm this issue on 2 machines. 
 
Kind Regards - Ian 
Comment 7 Michael Kefeder 2005-06-23 00:15:47 UTC
pear is missing because the eclass configures with the flag '--without-pear' -
can somebody please enlighten me why that is? There is no pear install ebuild
available, and pear is actually a vital part of PHP...

quick fix for people ending up without pear and don't want to recompile php -
run the following as root:

lynx -source http://go-pear.org/ | php
Comment 8 Markus Tacker 2005-06-23 00:35:16 UTC
or
$ wget http://go-pear.org -O go-pear.php
$ cat go-pear.php | php
Comment 9 Stuart Herbert (RETIRED) gentoo-dev 2005-06-23 15:25:23 UTC
For PHP 5, the PEAR-PEAR package will be responsible for 
installing /usr/bin/pear.  This allows us to update the PEAR installer more 
frequently, and prepares us in case the PEAR installer isn't bundled with a 
future version of PHP (I understand this is being debated upstream).

Best regards,
Stu
Comment 10 Ian P. Christian 2005-06-23 16:22:07 UTC
(In reply to comment #9) 
> For PHP 5, the PEAR-PEAR package will be responsible for  
> installing /usr/bin/pear.  This allows us to update the PEAR installer more  
> frequently, and prepares us in case the PEAR installer isn't bundled with a  
> future version of PHP (I understand this is being debated upstream). 
>  
> Best regards, 
> Stu 
 
(if dupes appear, sorry, I tried twice replying to this via email, I don't know 
if doing that works) 
 
This might be the case, but having installed x86 PEAR-PEAR, I still have  
no /usr/bin/pear. 
 
tribble ~ # qpkg -v -I PEAR-PEAR 
dev-php/PEAR-PEAR-1.3.5 * 
tribble ~ # ls /usr/bin/pear 
ls: /usr/bin/pear: No such file or directory 
 
Kind Regards, 
Comment 11 Ian P. Christian 2005-06-24 05:42:05 UTC
On another server, pear dissapared, so I tried to install PEAR-PEAR, but it 
needs pear installed! 
 
# emerge PEAR-PEAR -av 
 
These are the packages that I would merge, in order: 
 
Calculating dependencies ...done! 
[ebuild  N    ] dev-php/PEAR-XML_RPC-1.1.0  0 kB 
[ebuild  N    ] dev-php/PEAR-Archive_Tar-1.3.1  14 kB 
[ebuild  N    ] dev-php/PEAR-Console_Getopt-1.2  3 kB 
[ebuild  N    ] dev-php/PEAR-PEAR-1.3.5  105 kB 
 
Total size of downloads: 123 kB 
 
Do you want me to merge these packages? [Yes/No] 
>>> emerge (1 of 4) dev-php/PEAR-XML_RPC-1.1.0 to / 
>>> md5 files   ;-) ChangeLog 
>>> md5 files   ;-) metadata.xml 
>>> md5 files   ;-) PEAR-XML_RPC-1.1.0.ebuild 
>>> md5 files   ;-) PEAR-XML_RPC-1.2.2.ebuild 
>>> md5 files   ;-) files/digest-PEAR-XML_RPC-1.1.0 
>>> md5 files   ;-) files/digest-PEAR-XML_RPC-1.2.2 
>>> md5 src_uri ;-) XML_RPC-1.1.0.tgz 
>>> Unpacking source... 
>>> Unpacking XML_RPC-1.1.0.tgz to /var/tmp/portage/PEAR-XML_RPC-1.1.0/work 
tar: A lone zero block at 102 
>>> Source unpacked. 
>>> Test phase [not enabled]: dev-php/PEAR-XML_RPC-1.1.0 
 
>>> Install PEAR-XML_RPC-1.1.0 into /var/tmp/portage/PEAR-XML_RPC-1.1.0/image/ 
category dev-php 
/usr/portage/eclass/php-pear.eclass: line 49: pear: command not found 
 
!!! ERROR: dev-php/PEAR-XML_RPC-1.1.0 failed. 
!!! Function php-pear_src_install, Line 49, Exitcode 127 
!!! (no error message) 
!!! If you need support, post the topmost build error, NOT this status message. 
 
Comment 12 Jakub Moc (RETIRED) gentoo-dev 2005-06-24 06:34:59 UTC
*** Bug 96941 has been marked as a duplicate of this bug. ***
Comment 13 Jakub Moc (RETIRED) gentoo-dev 2005-06-24 06:41:02 UTC
(In reply to comment #9)
> For PHP 5, the PEAR-PEAR package will be responsible for 
> installing /usr/bin/pear. 

That's a nice idea but unfortunately you cannot install any PEAR package w/o
/usr/bin/pear so emerging PEAR-PEAR does not seem to solve the issue. This needs
some solution, chicken-and-egg problem.
Comment 14 Jakub Moc (RETIRED) gentoo-dev 2005-06-24 07:43:32 UTC
Uhm, wandering thru the PEAR ebuilds it seems that PEAR-PEAR-1.3.5-r1 has the
dependencies moved to PDEPEND.

Ian, please unmask that version and try that one, it should work. Looks OK here:

# emerge -pv =PEAR-PEAR-1.3.5-r1

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild  N    ] dev-php/PEAR-PEAR-1.3.5-r1  141 kB
[ebuild  N    ] dev-php/PEAR-XML_RPC-1.2.2  21 kB
[ebuild  N    ] dev-php/PEAR-Archive_Tar-1.3.1  0 kB
[ebuild  N    ] dev-php/PEAR-Console_Getopt-1.2  0 kB
Comment 15 Sebastian Bergmann (RETIRED) gentoo-dev 2005-06-24 10:09:33 UTC
PEAR-PEAR-1.3.5-r1 bootstraps PEAR and installs /usr/bin/pear.
Comment 16 Ian P. Christian 2005-06-24 15:20:59 UTC
# emerge -av PEAR-PEAR  
  
These are the packages that I would merge, in order:  
  
Calculating dependencies ...done!  
[ebuild     U ] dev-php/PEAR-PEAR-1.3.5-r1 [1.3.5] 0 kB  
  
Total size of downloads: 0 kB  
  
Do you want me to merge these packages? [Yes/No]  
>>> emerge (1 of 1) dev-php/PEAR-PEAR-1.3.5-r1 to /  
>>> md5 files   ;-) ChangeLog  
>>> md5 files   ;-) metadata.xml  
>>> md5 files   ;-) PEAR-PEAR-1.3.5-r1.ebuild  
>>> md5 files   ;-) PEAR-PEAR-1.3.5.ebuild  
>>> md5 files   ;-) files/digest-PEAR-PEAR-1.3.5  
>>> md5 files   ;-) files/digest-PEAR-PEAR-1.3.5-r1  
>>> md5 src_uri ;-) Archive_Tar-1.2.tgz  
>>> md5 src_uri ;-) Console_Getopt-1.2.tgz  
>>> md5 src_uri ;-) XML_RPC-1.2.0.tgz  
>>> md5 src_uri ;-) PEAR-1.3.5.tgz  
>>> Unpacking source...  
>>> Unpacking Archive_Tar-1.2.tgz to /var/tmp/portage/PEAR-PEAR-1.3.5-r1/work  
tar: A lone zero block at 163  
>>> Unpacking Console_Getopt-1.2.tgz  
to /var/tmp/portage/PEAR-PEAR-1.3.5-r1/work  
tar: A lone zero block at 27  
>>> Unpacking XML_RPC-1.2.0.tgz to /var/tmp/portage/PEAR-PEAR-1.3.5-r1/work  
tar: A lone zero block at 205  
>>> Unpacking PEAR-1.3.5.tgz to /var/tmp/portage/PEAR-PEAR-1.3.5-r1/work  
tar: A lone zero block at 1088  
>>> Source unpacked.  
>>> Test phase [not enabled]: dev-php/PEAR-PEAR-1.3.5-r1  
  
>>> Install PEAR-PEAR-1.3.5-r1 into /var/tmp/portage/PEAR-PEAR-1.3.5-r1/image/  
category dev-php  
/usr/portage/dev-php/PEAR-PEAR/PEAR-PEAR-1.3.5-r1.ebuild: line 98: pear:  
command not found  
  
!!! ERROR: dev-php/PEAR-PEAR-1.3.5-r1 failed.  
!!! Function install_pear_without_bootstrap, Line 98, Exitcode 127  
!!! (no error message)  
!!! If you need support, post the topmost build error, NOT this status message.  
  
 
 
So, this didn't work, I've tried uninstalling it, and reinstalling it, and this 
is what I get. 
 
# emerge -av PEAR-PEAR 
 
These are the packages that I would merge, in order: 
 
Calculating dependencies ...done! 
[ebuild  N    ] dev-php/PEAR-PEAR-1.3.5-r1  0 kB 
 
Total size of downloads: 0 kB 
 
Do you want me to merge these packages? [Yes/No] 
>>> emerge (1 of 1) dev-php/PEAR-PEAR-1.3.5-r1 to / 
>>> md5 files   ;-) ChangeLog 
>>> md5 files   ;-) metadata.xml 
>>> md5 files   ;-) PEAR-PEAR-1.3.5-r1.ebuild 
>>> md5 files   ;-) PEAR-PEAR-1.3.5.ebuild 
>>> md5 files   ;-) files/digest-PEAR-PEAR-1.3.5 
>>> md5 files   ;-) files/digest-PEAR-PEAR-1.3.5-r1 
>>> md5 src_uri ;-) Archive_Tar-1.2.tgz 
>>> md5 src_uri ;-) Console_Getopt-1.2.tgz 
>>> md5 src_uri ;-) XML_RPC-1.2.0.tgz 
>>> md5 src_uri ;-) PEAR-1.3.5.tgz 
>>> Unpacking source... 
>>> Unpacking Archive_Tar-1.2.tgz to /var/tmp/portage/PEAR-PEAR-1.3.5-r1/work 
tar: A lone zero block at 163 
>>> Unpacking Console_Getopt-1.2.tgz 
to /var/tmp/portage/PEAR-PEAR-1.3.5-r1/work 
tar: A lone zero block at 27 
>>> Unpacking XML_RPC-1.2.0.tgz to /var/tmp/portage/PEAR-PEAR-1.3.5-r1/work 
tar: A lone zero block at 205 
>>> Unpacking PEAR-1.3.5.tgz to /var/tmp/portage/PEAR-PEAR-1.3.5-r1/work 
tar: A lone zero block at 1088 
>>> Source unpacked. 
>>> Test phase [not enabled]: dev-php/PEAR-PEAR-1.3.5-r1 
 
>>> Install PEAR-PEAR-1.3.5-r1 into /var/tmp/portage/PEAR-PEAR-1.3.5-r1/image/ 
category dev-php 
>>> dobin: making pear executable... 
install ok: PEAR 1.3.5 
man: 
prepallstrip: 
strip: i686-pc-linux-gnu-strip --strip-unneeded 
strip: i686-pc-linux-gnu-strip --strip-unneeded 
>>> Completed installing PEAR-PEAR-1.3.5-r1 
into /var/tmp/portage/PEAR-PEAR-1.3.5-r1/image/ 
 
>>> Merging dev-php/PEAR-PEAR-1.3.5-r1 to / 
sed: can't read //usr/bin/pear: No such file or directory 
 
!!! ERROR: dev-php/PEAR-PEAR-1.3.5-r1 failed. 
!!! Function pkg_preinst, Line 37, Exitcode 2 
!!! (no error message) 
!!! If you need support, post the topmost build error, NOT this status message. 
 
 
Comment 17 Ian P. Christian 2005-06-24 15:57:40 UTC
having uninstalled *all* pear packages, and reinstalled PEAR-PEAR-1.3.5r1, it 
now works.   
How well will keeping PEAR in portage work when I often install packages via 
the PEAR installer? What with the advent of 'channels', a lot of packages will 
be installed directly into PEAR without using portage.   Will the PEAR-PEAR 
package be ok with this, or am I best installing PEAR outside of portage and 
maintaining it as normal rather then by portage? 
 
 
Comment 18 Stefan de Konink 2005-06-25 08:22:00 UTC
The current PEAR-PEAR has ${ROOT} in pkg_preinst, this probably should be ${D}.
Comment 19 Jakub Moc (RETIRED) gentoo-dev 2005-06-27 08:40:35 UTC
(In reply to comment #18)
> The current PEAR-PEAR has ${ROOT} in pkg_preinst, this probably should be ${D}.

That's probably why it fails for me as well. The only way I was able to install
PEAR-PEAR-1.3.5-r1 was to 

- change pkg_preinst to ${D} in the ebuild in my overlay
- run emerge --nodeps =PEAR-PEAR-1.3.5-r1
- save /usr/bin/pear somewhere else
- unmerge PEAR-PEAR
- copy pear script back to /usr/bin/pear
- and finally run emerge PEAR-PEAR again

Then it installs as expected, anything else fails. :/
Comment 20 Jakub Moc (RETIRED) gentoo-dev 2005-07-03 09:23:58 UTC
(In reply to comment #19)
Err, the workaround misses one step, as I noticed:

- move the ebuild in overlay out of the way, and _then_
> - and finally run emerge PEAR-PEAR again

Comment 21 Martin Schlemmer (RETIRED) gentoo-dev 2005-07-03 11:16:17 UTC
Here is maybe an easier way:

  # sed -i -e 's:/usr/lib/php:/usr/share/php:g' /usr/bin/pear
/usr/share/php/pearcmd.php
  # ebuild /usr/portage/dev-php/PEAR-PEAR/PEAR-PEAR-1.3.5-r1.ebuild clean unpack
compile install qmerge
  # emerge PEAR-PEAR

(Not sure about the ebuild line, but what I did ...)

The sed command is due to the installed /usr/bin/pear and
/usr/share/php/pearcmd.php not being fixed via eclass for their new locations :/

And lastly, there is an typo in the eclass :/  As it is currently, it moves all
php stuff in /usr/lib/php to /usr/share/php/php/, and not /usr/share/php/.

-----
Index: eclass/php5-sapi-r2.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/php5-sapi-r2.eclass,v
retrieving revision 1.20
diff -u -r1.20 php5-sapi-r2.eclass
--- eclass/php5-sapi-r2.eclass  27 Jun 2005 23:05:09 -0000      1.20
+++ eclass/php5-sapi-r2.eclass  3 Jul 2005 17:10:57 -0000
@@ -558,7 +558,7 @@
        rm -rf ${D}/usr/lib/php/build
        dodir /usr/share/php

-       for x in ${D}/usr/lib/php ; do
+       for x in ${D}/usr/lib/php/* ; do
                if [ "`basename $x`" != 'extensions' ]; then
                        mv $x ${D}/usr/share/php
                fi
-----
Comment 22 Jakub Moc (RETIRED) gentoo-dev 2005-07-03 12:28:31 UTC
(In reply to comment #21)
> Here is maybe an easier way:

Looks better, tnx.

> And lastly, there is an typo in the eclass :/  As it is currently, it moves 
> all php stuff in /usr/lib/php to /usr/share/php/php/, and not /usr/share/php/.

Oh, luckily I did not hit that one, since php-5.1 uses -r3 which does not seem
to have this problem.
Comment 23 Sebastian Bergmann (RETIRED) gentoo-dev 2005-07-03 22:34:57 UTC
The use of ${ROOT} in pkg_preinst() is correct as the migration from
/usr/lib/php to /usr/share/php has to happen in, well, ${ROOT}. The problem you
guys encountered stemmed from the fact that (at least in my case, see below)
/usr/lib/php existed but was empty after a clean installation of
dev-php/php-5.1.0_beta. I have fixed this now by adding a safeguard to the sed call.

On my system, a clean install (ie., no /etc/php, no /usr/lib/php, no
/usr/bin/pear, ...) of dev-php/php-5.1.0_beta and dev-php/PEAR-PEAR-1.3.5-r1 now
works fine.
Comment 24 Sebastian Bergmann (RETIRED) gentoo-dev 2005-07-05 13:36:58 UTC
Only package.masked versions of PHP (php, php-cgi, and mod_php packages) do not
install PEAR.

If you use PHP 5.1 and want to emerge PEAR-* packages you have to unmask and
install PEAR-PEAR-1.3.5-r1.

If you use PHP 5.1 and want to emerge PECL-* packages you have to unmask and
install phpconfig.