如何检查PEAR是否安装在我的服务器上? [英] How Do I Check To See If PEAR Is Installed On My Server or Not?
问题描述
我收到错误:
警告:include_once(Net / SMTP.php)[function.include-once]:failed打开流:在第349行的/usr/local/lib/php/Mail/smtp.php中没有这样的文件或目录
Warning: include_once(Net/SMTP.php) [function.include-once]: failed to open stream: No such file or directory in /usr/local/lib/php/Mail/smtp.php on line 348
警告:include_once()[function。 include]:在/ usr / local / lib / php / Mail / smtp中打开Net / SMTP.php以禁止包含(include_path ='。:/ usr / lib / php:/ usr / local / lib / php') .php在线348
Warning: include_once() [function.include]: Failed opening 'Net/SMTP.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /usr/local/lib/php/Mail/smtp.php on line 348
致命错误:类Net_SMTP没有在第349行的/usr/local/lib/php/Mail/smtp.php中找到
Fatal error: Class 'Net_SMTP' not found in /usr/local/lib/php/Mail/smtp.php on line 349
我的代码:
require_once 'Mail.php';
$from = "me@example.com>";
$to = "you@gmail.com>";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "mail.example.com";
$username = "me";
$password = "test";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
推荐答案
您可以登录并运行
which pear
如果安装它将打印像这样的
if it's installed it will print something like this
/usr/bin/pear
这篇关于如何检查PEAR是否安装在我的服务器上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!