Manually install pear packages
1. Download the package from pear.php.net/packages.php
eg.
# wget http://download.pear.php.net/package/HTML_Table-1.8.3.tgz
2. Install downloaded file
# pear installl HTML_Table-1.8.3.tgz
Note: with .tgz
3. Install from pear again
# pear install HTML_Table-1.8.3
Note: without .tgz
4. Verify the installed packages
# pear list
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.7 stable
Console_Getopt 1.2.3 stable
HTML_Common 1.2.5 stable
HTML_Table 1.8.3 stable
PEAR 1.9.4 stable
Structures_Graph 1.0.4 stable
XML_RPC 1.5.4 stable
XML_Util 1.2.1 stable
5. Verify installed package location
# ls /usr/share/pear/HTML/Table.php
install pyrus
Add pear channels
Sometimes pear.php.net not work for install packages, so add more channels:
# pear channel-discover pear.netpirates.net
# pear channel-discover components.ez.no
# pear config-set auto_discover 1
# pear install pear.phpqatools.org/phpqatools PHPDocumentor
# pear channel-discover components.ez.no
php_network_getaddresses error
Issue:
# pear upgrade pear
returns:
php_network_getaddresses: getaddrinfo failed: Name or service not known
Solution:
# chmod a+r /etc/resolv.conf # chmod a+r /etc/nsswitch.conf
nsswitch.conf issue
Issue:
1. Ping OK
# ping http://www.google.ca
Response is normal.
2. Some downloads work, but some not
# wget http://www.centos.org
This and other downloads work
But
# wget http://www.google.ca
returns:
wget: unable to resolve host address http://www.google.ca
Solution:
1. vi /etc/nsswitch.conf
2. Change line of
hosts: files dns
to
hosts: files dns mdns4_minimal [NOTFOUND=return] mdns4
This change fixed the issue and resolve dns normal.
pear error
Issue:
# pear install HTML_Common2
Package “HTML_Common2” Version “2.0.0” does not have REST xml available
install failed
Solution:
This is related to dns resolve problem.
Check:
# wget pear.php.net
Returns:
wget: unable to resolve host address pear.php.net
–> refer to nsswitch.conf issue.