Search code examples
phpinstallationpear

PHP: Does PEAR really INSTALL, or does it simply download and unpack a library of PHP code?


Background: Hi, I'm using PHP 5.3 on a Windows 7 machine as a part of the WAMP server package. I've been trying to get my PHP code to send a verification email to newly registered users, but I've stumbled upon a problem that is the mail()-function. As you probably know, the mail()-function is really basic, and doesn't use SMTP Authentication. Since I'm only using this platform while developing my web application, and don't know where it'll run in the end, I should probably prepare for having to use SMTP Authentication.

The problem: After a few Google searches it seems like the only widely used method is PEAR's Mail package. Now, I don't know if I'm stupid or if it really has to do with the language barrier (English isn't my mothern tongue), but even after being on PEAR's website and reading about what it is, I still don't understand it completely. So, there is this PEAR Package Manager which "installs" whatever PEAR package you want, right? How exactly does it do that? Is it simply extracting PHP code into some folder, for me to include later in my .php files? Does it alter any default PHP stuff (like functions) that I should be aware of? I mean, if I never include any PEAR libraries in my code, will the code run like PEAR would never have been "installed"? If not, is there any significant performance issues I should be aware of (like a default PHP function taking longer to execute now that PEAR is installed)? What about vulnerabilities for some kind of injection (like SQL Injection)?


Solution

  • PEAR "installs" just download and extract the PHP code to a directory in the include path.

    PECL on the other hand downloads, compiles and delivers the executable extension.

    On a sidenote, you probably don't want to use PEAR Mail, SwiftMailer is regarded as the best ATM.