Usr lib php pear

sudo: pear: command not found

Many ways to skin this cat, but I would type this if you have locate installed (which you probably do):

That should list one or more things, one of which will look like the path to pear. Let’s say it says something like /usr/local/bin/pear . Then your next command is:

  1. It’s possible that locate will list multiple executable pear files. If that’s the case, it may be important to pick the right one based on which PHP you’re using.
  2. You may want to add the directory where pear is located to your PATH environment variable.

locate is not installed. I know the path which is /usr/lib/php/share/pear but the weird thing is that even if i go to that directory i still can’t run pear

That’s not the directory where the pear command-line binary is installed. What happens when you type locate bin/pear in a terminal prompt? Locate is installed by default on every Mac OS X installation I’ve ever seen, so I’m suprised to see you say it is not installed. If it truly is not installed, try whereis pear .

If all else fails, you can try sudo /usr/local/bin/pear and sudo /usr/local/php5/bin/pear . I’ve seen pear end up in both locations on Mac OS X. If you really have no idea where it is but are certain it’s there somewhere, and you can afford to be very patient you can try something thorough but inefficient like: sudo find / -name pear but that could take a long time to run. I would be prepared to give it hours at a minimum. That would be for truly desperate times only, I suspect. (And it might be a bad idea to run on a production server.)

Читайте также:  Python tkinter active background

Источник

Configuring your PEAR setup

The default settings suffice for novice users, there is rarely a need to change them when getting started. You can go on with installing packages.

Reading single values is accomplished by using config-get . The following command will show you where all the .php files of your installed pear packages reside.

$ pear config-get php_dir /usr/share/pear

Changing a value is as easy as retrieving it:

$ pear config-set preferred_state beta config-set succeeded

When changing a config setting, it does not immediately get applied to already installed packages. This is especially true when changing variables like data_dir . Use $ pear upgrade —force to reinstall all packages in such cases.

Config options

Variable Name Description Default Value
bin_dir Directory where executables are installed /usr/bin
doc_dir Directory where documentation is installed /usr/lib/php/docs
ext_dir Directory where loadable extensions are installed ./
php_dir Directory where PHP files are installed (like PEAR files) /usr/lib/php
cache_dir PEAR installer cache directory, and used by XMLRPC /tmp/pear/cache
data_dir Directory where data files are installed /usr/lib/php/data
php_bin The PHP CLI or CGI binary for executing scripts /usr/bin/php
test_dir Directory where regression tests are installed /usr/lib/php/tests
cache_ttk Number of seconds that the local cache is used, and not updated (Time To Kill) 3600
preferred_state Preferred package state: stable, beta, alpha, devel, or snapshot stable
umask umask used when creating files (Unix-like systems only) 22
verbose Debug log level: 0-3 where 3 is full debug mode. 1
http_proxy The optional HTTP proxy address (host:port) used when downloading packages
remote_config Remote configuration file, used to mirror a local installation on a remote server through ftp. (PEAR 1.4+)
auto_discover Auto-discover new channels from command line or dependencies 0
default_channel Default channel (PEAR 1.4+) pear.php.net (pecl.php.net if using the pecl command)
preferred_mirror Preferred channel mirror (PEAR 1.4+) pear.php.net (pecl.php.net if using the pecl command)
master_server PEAR server [deprecated in PEAR 1.4+] pear.php.net
password PEAR password (used by maintainers)
sig_bin Signature handling program /sw/bin/gpg
sig_keydir Signature key directory /etc/pearkeys
sig_keyid The key used for signing
sig_type Package signature type (only gpg) gpg
username PEAR username (used by maintainers)

Источник

Where else could /usr/local/lib/php be?

I’m developing an application in PHP on a Linux server. The server has at least two different versions of php installed on it: 5.2.0 and 5.2.9. The 5.2.0 version has the following directory /usr/local/lib/php in the include_path in php.ini. I need to find out where the 5.2.9 version of this directory is located. I checked the include_path setting in the 5.2.9 php.ini but it only has . and /usr/share/pear for include_path . (Note that I just installed pear right now, since the 5.2.9 php was originally configured without pear.) The files in /usr/share/pear do not seem to match what I see in /usr/local/lib/php and it seems a little absurd to tell pear that php_dir is /usr/share/pear . Any ideas? UPDATE — Is it possible that /usr/local/lib/php also belongs to php 5.2.9? Is there anything within this directory itself I can look at, to see?

4 Answers 4

If the directory you’re looking for exists (it might not if you excluded pear during install): The default location would be /xxx/lib/php where /xxx is the installation prefix.

For example, on one of my servers, one of my PHP executables (I have 4 versions installed) is located /custom/php5.3.5/bin/php so it’s corresponding PEAR/general library directory is /custom/php5.3.5/lib/php

( /custom/php5.3.5 being the installation prefix, normally it would be /usr/local or /usr .)

If your lib/php directory has a pearcmd.php file, call (yourphpbin) pearcmd.php info pear and it should be able to tell you pear version, it’s requirements and whatnot. (If pearcmd.php exists, there’s a good chance pear exists in that directory.) The pear shell-script would by default be at /xxx/bin/pear again /xxx being the installation prefix.

As far as I’m aware, you can set it up so that PEAR is shared among multiple versions of PHP. I would assume that’s how the /usr/share/pear one is set up. (Distribution repository-provided?) Not sure if the same holds true for pecl . If you have multiple installs of pear, you just need to make sure you install the packages you want to use into the right pear install.

PHP will happily use whatever PEAR installation you tell it to in include_path.

Источник

Оцените статью