Re: second/custom PEAR/PECL installation. possible? how?
| From: | Jochem Maas | Date: | Wed, 06 Jun 2007 17:56:04 +0000 |
| Subject: | Re: second/custom PEAR/PECL installation. possible? how? | ||
| References: | 1 2 | Groups: | php.general php.pear.general |
| Request: | Send a blank email to php-general+get-256206@lists.php.net to get a copy of this message | ||
hi Greg,
thanks so much for taking the time to give such a detailed run down
(and a complete solution) ...
Greg Beaver wrote:
> Jochem Maas wrote:
...
>
> Hi Jochem,
>
> If you're having PEAR questions, ask on the pear-general list. It's
> pure luck that I happened upon your message, and nobody on php-general
> seems to know jack about PEAR.
they don't indeed :-) I'll make my way over to the pear-general list
in future. thanks for the reminder.
>
> The solution is quite easy.
>
> You need separate configuration files for PEAR in PHP5. To get this
> going, you should first install a local copy of PEAR for PHP5 only.
>
> Assuming you have PEAR in /usr/local/lib/php, the best choice is to
> install another copy in /usr/local/lib/php5:
>
> First you'll need to create a new configuration file, which you can save
> as "/etc/pear5.conf". Your php4 conf will be in /etc/pear.conf. Then
> you need to create a new directory for downloads to avoid conflicts
> (easy). The most important part is to set the php_bin variable to the
> path to php5 and finally install your custom copy of PEAR. I assume you
> are using "php5" as the CLI for PHP 5. Change this to the right name in
>
which php5 if I'm wrong.
>
> sudo pear config-create /usr/local/lib/php5 /etc/pear5.conf
> sudo pear -c /etc/pear5.conf config-set php_bin which php5
> sudo pear -c /etc/pear5.conf config-set download_dir /tmp/pear5
> mkdir /tmp/pear5
> chmod 0777 /tmp/pear5
> sudo pear -c /etc/pear5.conf up PEAR
>
> At this point you will have a new pear and pecl executable stored in
> /usr/local/lib/php5/pear/. You'll also want to set the ext_dir to the
> location of your extension_dir in php.ini for php5.
>
> sudo pear -c /etc/pear5.conf config-set ext_dir /path/to/php5/ext
>
> Finally, as a convenience, you'll probably want to use ln to make
> "pear5" and "pecl5" commands
>
> sudo ln -s /usr/local/lib/php5/pear/pear /usr/local/bin/pear5
> sudo ln -s /usr/local/lib/php5/pear/pecl /usr/local/bin/pecl5
>
> Lastly, you will *always* want to call with the -c option
I suppose I could setup global [bash] aliases that would
include the -c option. no?
>
> pecl5 install APC
>
> will still use your default configuration file at /etc/pear.conf.
>
> pecl5 -c /etc/pear5.conf install APC
>
> will correctly install and configure APC for php5.
>
> Needless to say, this is more complicated than it seems like it should
> be, and the next version of the PEAR installer.
maybe a bit convoluted, but following the steps you set out is cinch
compared to trying to figuring it out on my own (and hoping I had got it
right).
> Pyrus, makes this
> process MUCH easier. Pyrus has only just been started, and so is barely
> past proof-of-concept.
>
> I hope this helps out.
you bet! your detailed explanation is just the ticket!
>
> Greg