This forum is no longer active. Please post your questions to our new community site

Forums MAMPStack

How to load Pear modules? Newbie help

Subscribe to How to load Pear modules? Newbie help 7 post(s), 3 voice(s)

 
Avatar Andrew E 3 post(s)

I want to use Pear’s Mail function. But, require ‘Mail.php’; can’t find Mail.php. I notice there are some Pear stuff in the php directory, but I don’t know how to add missing modules to the Mampstack, or if that is my problem in this case. Thanks in advance for your help.

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi Andrew,

You can install the Mail pear package with this command:


$ cd /Applications/mampstack-*/php/bin
$ ./pear install mail

and you can see something like this:


OS-X-10-5-x86:bin beltran$ ./pear install mail
Did not download optional dependencies: pear/Net_SMTP, use --alldeps to download automatically
pear/Mail can optionally use package "pear/Net_SMTP" (version >= 1.1.0)
downloading Mail-1.2.0b1.tgz ...
Starting to download Mail-1.2.0b1.tgz (20,828 bytes)
........done: 20,828 bytes
install ok: channel://pear.php.net/Mail-1.2.0b1

Then you can check that the Mail.php file is in the php/lib/php directory.

I hope it helps you.

 
Avatar Andrew E 3 post(s)

I think I solved my own problem.

I executed: <mampstack-dir>/php/bin/pear/pear install mail

That placed Mail.php inside: <mampstack-dir>/php/lib/php
After that, my php file was able to locate it.

 
Avatar Andrew E 3 post(s)

Oh thanks beltran. Apparently I discovered that already before refreshing this page :-)

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hehehe :) Nice dude.

 
Avatar DLo 8 post(s)

i am using mamp v1.2.0 and getting the following


daniel-lopezs-macbook-pro:bin dlopez$ cd /Applications/mampstack-1.2-0/php/bin daniel-lopezs-macbook-pro:bin dlopez$ ./pear install Net_GeoIP-1.0.0RC2 pear.php.net is using a unsupported protocal - This should never happen. install failed

does this with any pear module I try to install

 
Avatar DLo 8 post(s)

i did the following


daniel-lopezs-macbook-pro:bin dlopez$ cd /Applications/mampstack-1.2-0/php/lib/php/ daniel-lopezs-macbook-pro:bin dlopez$ mv .channels .channels-broken daniel-lopezs-macbook-pro:bin dlopez$ ./pear update-channels Updating channel "doc.php.net" Channel "doc.php.net" is up to date Updating channel "pear.php.net" Channel "pear.php.net" is up to date Updating channel "pecl.php.net" Channel "pecl.php.net" is up to date


i can now install pear modules

Forums MAMPStack