Using Pear with PHP 5.3

software development


Just set a domain to use php5.3 with fastcgi. I’ve been trying to install some new pear libraries which require php5.3, but I am getting the following error which leads me to believe that pear is still invoking php5.2.

[quote][spurs]$ pear install MDB2-2.5.0b3
pear/MDB2 requires PHP (version >= 5.3.0), installed version is 5.2.17
No valid packages found
install failed[/quote]

Here is what my pear config looks like:[code]Configuration (channel

Auto-discover new Channels auto_discover
Default Channel default_channel
HTTP Proxy Server Address http_proxy
PEAR server [DEPRECATED] master_server
Default Channel Mirror preferred_mirror
Remote Configuration File remote_config
PEAR executables directory bin_dir /home/supposed/pear
PEAR documentation directory doc_dir /home/supposed/pear/docs
PHP extension directory ext_dir /home/supposed/pear/ext
PEAR directory php_dir /home/supposed/pear/php
PEAR Installer cache directory cache_dir /home/supposed/pear/cache
PEAR configuration file cfg_dir /usr/local/php5/lib/pear/cfg
PEAR data directory data_dir /home/supposed/pear/data
PEAR Installer download download_dir /tmp/pear/download
PHP CLI/CGI binary php_bin /usr/local/php53/bin/php
php.ini location php_ini /etc/php53/php.ini
–program-prefix passed to php_prefix
PHP’s ./configure
–program-suffix passed to php_suffix
PHP’s ./configure
PEAR Installer temp directory temp_dir /tmp/pear/temp
PEAR test directory test_dir /home/supposed/pear/tests
PEAR www files directory www_dir /usr/local/php5/lib/pear/www
Cache TimeToLive cache_ttl 3600
Preferred Package State preferred_state stable
Unix file mask umask 2
Debug Log Level verbose 1
PEAR password (for password
Signature Handling Program sig_bin /usr/bin/gpg
Signature Key Directory sig_keydir /usr/local/php5/etc/pearkeys
Signature Key Id sig_keyid
Package Signature Type sig_type gpg
PEAR username (for username
User Configuration File Filename /home/supposed/.pearrc
System Configuration File Filename /usr/local/php5/etc/pear.conf
[/code]The paths that reference php5 actually don’t exist, but I can’t find any replacement that would work (such as /usr/local/php5/lib/pear/www).

I’ve also updated my $PATH variable so that I can invoke php 5.3 from the command line: [quote][spurs]$ php -v
PHP 5.3.13 (cli) (built: Jun 7 2012 17:53:07)
Copyright © 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright © 1998-2012 Zend Technologies
with Suhosin v0.9.32.1, Copyright © 2007-2010, by SektionEins GmbH
[spurs]$ [/quote]
Any suggestions?


Looks like I was able to solve the problem by setting the PHP_PEAR_PHP_BIN environment variable:

export PATH=/usr/local/php53/bin/:$PATH export PHP_PEAR_PHP_BIN=/usr/local/php53/bin/php

[quote][spurs]$ pear version
PEAR Version: 1.9.1
PHP Version: 5.3.13
Zend Engine Version: 2.3.0
Running on: Linux spurs #8 SMP Mon Oct 10 13:33:17 PDT 2011 x86_64