50

I am using a Debian squeeze server. I have installed PEAR using aptitude install php-pear. This created a directory /usr/share/php/PEAR.

I installed some PEAR packages including Phing. I installed the Phing files using pear install --alldeps phing/phing and the files showed up in /usr/share/php/phing.

But shouldn't PEAR packages (under normal circumstances) be put in /usr/share/php/PEAR? When I run

pear config-get php_dir

I get "/usr/share/php". Have I got something configured wrong?

rlandster
  • 7,294
  • 14
  • 58
  • 96

8 Answers8

39
/usr/share/php/

is correct for Debian.

/usr/share/php/PEAR

itself contains classes for PEAR itself.

The reason for using /usr/share/php is that the pear CLI tool is an installer that installs libraries (or applications) for PHP - choosing php is thus correct.

cweiske
  • 30,033
  • 14
  • 133
  • 194
  • 1
    PEAR was not meant for this. But you could try with a custom config that you pass with the -c parameter - but that one does not support relative paths. – cweiske Aug 20 '17 at 06:34
24

Yes, that is the correct directory on Debian, and Ubuntu.

Regardless of which O/S you are using, you can find the correct install directory by running: pear config-get php_dir via a console. And you get full directory path.

For example, with XAMPP application on Microsoft Window you have to go to XAMPP installation directory path <<XAMPP Installation folder path>>/bin and use ./pear config-get php_dir which lead to execute the binary file using current location and do the same job.

Wil
  • 757
  • 9
  • 12
vrkansagara
  • 606
  • 6
  • 13
  • 4
    This should be the accepted answer. Not only does it show a non-specific OS solution, it also compensates for the situation where an admin configures PEAR to be located in a non-default location. – James John McGuire 'Jahmic' Oct 13 '17 at 15:28
2

in case php is installed in /usr/local/php

pear is here:

/usr/local/php/lib/php

Nick
  • 9,962
  • 4
  • 42
  • 80
1

I am using Mac OSX Lion. I installed pear in /usr/lib/php/pear

So the data also be installed there.

itsazzad
  • 6,868
  • 7
  • 69
  • 89
1

On my installation of Debian PEAR is located here:

/usr/local/lib/php
Mathlight
  • 6,436
  • 17
  • 62
  • 107
kleinermann
  • 55
  • 2
  • 10
1

Just throwing this out there, in case you have pear installed in a round-about way:

cd /
find . -type d -name pear

For example, I was using MAMP on one of my local machines and it was in a really weird place.

nerdlinger
  • 1,610
  • 2
  • 17
  • 24
1

On my 64-bit Ubuntu system, the pear packages are installed to /usr/share/php/PEAR/, but I do not know how to change the pear install path. Maybe you can configure this somewhere.

Feliks Montez
  • 548
  • 3
  • 15
Jakob Alexander Eichler
  • 2,988
  • 3
  • 33
  • 49
0

If you're using CPanel to install them they're much likely to be located in

./opt/cpanel/ea-php{VERSION}/root/usr/share/pear
Amaynut
  • 4,091
  • 6
  • 39
  • 44