9/11/2023 0 Comments Upgrading python in mamp installWhen i execute “/Applications/MAMP/bin/php5.3/bin/pear install -a Mail” the terminal tell me that mail is all ready install with the same version and there is no update to it… So, to install PEAR Mail type the following in Terminal…’ to install PEAR Mail in MAMP. Now follow the instructions in one of my previous comments posted on February 2nd that begins ‘MAMP 1.9.4 comes with PHP 5.3.2 as the default. Hereafter all PEAR packages will be installed in the /Applications/MAMP/bin/php5/lib/php directory. You’ll get the message config-set succeeded. Pear config-set php_dir '/Applications/MAMP/bin/php5/lib/php' However, I would recommend the second solution for now: The first is to delete the ~/.pearrc file forcing the correct php_dir setting in the individual nf file to be used. As this directory already contains a PEAR Mail install you’ll get the message similar to pear/Mail is already installed and is the same as the released version 1.2.0 install failed. Consequently, when you try to install PEAR Mail for MAMP with the command /Applications/MAMP/bin/php5.3/bin/pear install -a Mail it is trying to install Mail in /usr/local/PEAR. The php_dir setting in ~/.pearrc appears to always take priority over that in the nf file. In your case this setting is /usr/local/PEAR which corresponds to the Mac OS X install. However, all three installs share a single PEAR user configuration file named ~/.pearrc which also contains a php_dir setting. This file contains the php_dir setting which is different for each install. Each install has its own individual PEAR system configuration file named nf. You have three PEAR installs: Mac OS X, MAMP and XAMPP. It’s enough to drive you insane, isn’t it! Require_once “/Applications/MAMP/bin/php5/lib/php/Mail.php” Second, SMTP.php itself is requiring Socket.php as a dependency but the relative path is wrong so you must EDIT that SMTP.php file by changing the line…įinally, you can now require your Mail.php file BUT IT ALSO MUST SPECIFY THE EXACT PATH… Require_once “/Applications/MAMP/bin/php5/lib/php/Net/SMTP.php” So, BEFORE you try to “require_once” the Mail.php file you must first require_once the SMTP.php file but you MUST USE THE EXACT PATH… Applications/MAMP/bin/php5/lib/php/Net/SMTP.php NOT SO… there seems to be THREE more issues.įirst, Mail.php is dependent on Net_SMTP, which is really a file called SMTP.php located here… Applications/MAMP/bin/php5.3/bin/pear config-get php_dirĪt this point one would think, with the correct path… things would work correctly. Applications/MAMP/bin/php5.2/bin/pear config-get php_dir Indeed, following Steve’s advice in his Feb 16 post I reset the path so these terminal commands… OK… Steve got close but with his help I was able to figure this out. If you don’t use virtual hosts, simply point your browser to THERE IS MORE TO THE STORY… If successful, you should receive an email.ġ This example assumes you have configured a virtual host in either MAMP or XAMPP for mysite called local.mysite. $mail = $smtp->send($recipient, $headers, $body) Identify the mail server, username, password, and port $body = "PEAR Mail successfully sent this email." You’ll need to change the values for $sender, $recipient, $server, $username, $password and optionally $port to match your email configuration. In this example I’ll save the file as PEARMailTest.php in the root directory of mysite. To ensure you can send an email, copy the code below and save it as a file in the root directory of your site. For example, the Mail_Queue package requires Mail, and Net_Socket is also required by the Net_POP3 and HTTP_Request packages to name but two. Unlike the package installation in MAMP, I’d not recommend uninstalling Mail and its dependencies in XAMPP because of the other PEAR packages that are pre-installed. To ensure the installation was successful and you can send mail see Sending a Test eMail. The relevant directories are located in the /Applications/XAMPP/xamppfiles/lib/php/pear/ directory: Auth, Mail and Net. To force the upgrade of Mail and its dependencies change the -a flag to -af. These are currently Auth_SASL, Net_SMTP and Net_Socket. The -a flag ensures that Mail‘s dependencies are also upgraded. Not doing so will result in the upgrade failing. Note that we need to prefix the command with sudo. Sudo /Applications/XAMPP/xamppfiles/bin/pear upgrade -a Mail
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |