Forums MAMPStack

How to load Pear modules? Newbie help

Subscribe to How to load Pear modules? Newbie help 5 post(s), 2 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 beltran Administrator 392 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 beltran Administrator 392 post(s)

Hehehe :) Nice dude.

Forums MAMPStack