Where do PEAR packages normally get installed?
Asked Answered
S

8

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?

Submariner answered 17/3, 2011 at 2:33 Comment(0)
S
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.

Schopenhauer answered 6/4, 2011 at 13:10 Comment(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.Schopenhauer
M
25

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.

Medulla answered 23/5, 2016 at 13:8 Comment(1)
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.Smut
M
2

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

pear is here:

/usr/local/php/lib/php

Masters answered 20/5, 2014 at 10:7 Comment(0)
K
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.

Kitts answered 17/3, 2011 at 2:59 Comment(0)
B
1

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

So the data also be installed there.

Beckett answered 6/3, 2013 at 19:41 Comment(0)
V
1

On my installation of Debian PEAR is located here:

/usr/local/lib/php
Vange answered 14/8, 2015 at 10:57 Comment(0)
D
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.

Donettedoney answered 2/3, 2018 at 21:12 Comment(1)
This helped. Im using cPanel.Pradeep
H
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
Halford answered 4/2, 2020 at 20:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.