简体   繁体   中英

PHP 5.4 and PEAR mail

I have some important scripts on my website at "1and1 Internet" that have been using PEAR mail under PHP 5.2. Since it's not my server, I have no control over what's installed.

They recently sent an email informing me that they now have PHP 5.4 available and will be removing earlier versions in a few months. So I switched my account config to try the scripts on 5.4 and found that they fail! The failure is on the require_once lines for Mail.php and Mail/mime.php , presumably because they don't exist or can't be found.

Looking at output from phpinfo() , it looks to me like the same --with-pear config switch is there in both versions, but on 5.4 I also see something to do with PEAR in a section about Phar , and I have no idea what Phar is!

Anyway, is there something more specific that I can try before attempting to contact support at 1and1? Fortunately I am able to return things to 5.2 until I get it all working!

First you need to check if pear is installed.

I assume you have shell access, so that would be simply:

$ pear

That would give you a list of commands if pear is installed.

Then you need to install the Mail package (probably as root...):

$ pear install Mail

And other packages you might need like Mail_Mime , etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM