Setting up PEAR with MacPorts

For a long time I am a happy MacPorts user now. My standard PHP setup has always included the pear variant:
port install php5 +apache2 +fastcgi +pear
Until now.

When I tried out PHP 5.4 recently using an early portfile for it, I noticed it didn't have the pear variant anymore. I inquired about this and learned that there also won't be that variant anymore. Instead one should install PEAR using the separate packages provided for this. So I decided to start using this for my regular PHP 5.3 setup as well, as it seems more future proof. Works fine if one knows how to set it up.
port install pear-PEAR
That almost it. The pear command ends up in /opt/local/lib/php/pear/bin, so you want to add that to your path. Also be aware you need to reinstall PEAR packages you already had installed with the old PEAR.

The nice thing about the new setup is that everything pear-releated is in it's own directory as opposed to the mix of PEAR and other stuff I had before.

When all was set up I installed what I needed using the pear command directly, even though the MacPorts people would love you to use the already ~550 ports available with PEAR packages (see port search pear-).

Hope that helps someone.


Anonymous said...

Wow I was looking all over for that, evidently they used to put it into /opt/local/bin and I could not figure out why it hadn't appeared in there. Thanks!

Chris Young said...

you have said what I need to do to install pear for php5.3 but this doesn't seem to work for php5.4 - did you do something different?

Unknown said...

Chris, I just checked my setup and I still have pear-PEAR installed (next to php53 and php54). It needs a bit of setup to have both PHP versions use the same include path, but other than that I don't remember any changes I needed to apply.

Anna Schafer said...

I must say that overall I am really impressed with this blog. It is easy to see that you are passionate about your writing.Aston Martin Chiptuning

Anna Schafer said...

Power point meaning in Hindi : Get detailed meaning of POWER POINT in Hindi language.Powerpoint In hindi

Anna Schafer said...

This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more. Gewinne

PHP7 Thoughts said...

Article has been really helpful and as I rarely use Mac, after visiting this website explored some of the easy to use tricks on Mac which will help in better setup of development tools on this Operating System.

Elizabeth J. Neal said...

I really impressed after read this because of some quality work and informative thoughts . I just wanna say thanks for the writer and wish you all the best for coming!. Pflegetagegeldversicherung

Tanika Co Valda said...

I have read your blog its very attractive and impressive. I like it your blog.

PHP 7 Training in chennai | PHP 7 Training Course

PHP 7 Training in chennai | Online PHP 7 Course

Tangki Fiber said...

I feel this is among the such a lot vital info for me. And i am satisfied studying your article. However wanna commentary on few general things, The website style is ideal, the articles is truly nice
Tangki Panel

Anna Schafer said...

I appreciate everything you have added to my knowledge base.Admiring the time and effort you put into your blog and detailed information you offer.Thanks. this website

Anna Schafer said...

Please share more like that. see here

Radley Co Tad said...

Great Article

PHP Based Projects for Final Year Students
Final Year Project Centers in Chennai

Spring Training in Chennai
Spring Training in Chennai