【发布时间】:2014-03-12 05:39:15
【问题描述】:
不知道有没有人经历过。我试图安装 PEAR Mail,以便我可以使用外部服务器发送电子邮件。但是当我输入以下命令时,我不断收到错误消息:
:~# pear install Mail Mail_Mime
这是错误信息:
Warning: mkdir(): File exists in System.php on line 277
PHP Warning: mkdir(): File exists in /usr/share/php/System.php on line 277
Warning: mkdir(): Not a directory in System.php on line 277
PHP Warning: mkdir(): Not a directory in /usr/share/php/System.php on line 277
Did not download optional dependencies: pear/Net_SMTP, use --alldeps to download automatically
pear/Mail can optionally use package "pear/Net_SMTP" (version >= 1.4.1)
Warning: mkdir(): File exists in System.php on line 277
PHP Warning: mkdir(): File exists in /usr/share/php/System.php on line 277
Warning: mkdir(): Not a directory in System.php on line 277
PHP Warning: mkdir(): Not a directory in /usr/share/php/System.php on line 277
download directory "/build/buildd/php5-5.3.2/pear-build-download" is not writeable. Change download_dir config variable to a writeable dir
Error: cannot download "pear/Mail"
Warning: mkdir(): File exists in System.php on line 277
PHP Warning: mkdir(): File exists in /usr/share/php/System.php on line 277
Warning: mkdir(): Not a directory in System.php on line 277
PHP Warning: mkdir(): Not a directory in /usr/share/php/System.php on line 277
download directory "/build/buildd/php5-5.3.2/pear-build-download" is not writeable. Change download_dir config variable to a writeable dir
Error: cannot download "pear/Mail_Mime"
Download failed
install failed
我做错了什么吗?我正在开发 Ubuntu。
<?php
require_once "Mail.php";
$from = "Sandra Sender <info@me.org>";
$to = "Ramona Recipient <some@somedomain.com>";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "ssl://xxx.xxx.xxx";
$port = "465";
$username = "me@domain.org";
$password = "password";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'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>");
}
?>
任何帮助将不胜感激。
更新: 使用 -alldeps 运行也无济于事 :~# pear install --alldeps Mail Mail_Mime
Warning: mkdir(): File exists in System.php on line 277
PHP Warning: mkdir(): File exists in /usr/share/php/System.php on line 277
Warning: mkdir(): Not a directory in System.php on line 277
PHP Warning: mkdir(): Not a directory in /usr/share/php/System.php on line 277
WARNING: "pear/Auth_SASL" is deprecated in favor of "pear/Auth_SASL2"
Warning: mkdir(): File exists in System.php on line 277
PHP Warning: mkdir(): File exists in /usr/share/php/System.php on line 277
Warning: mkdir(): Not a directory in System.php on line 277
PHP Warning: mkdir(): Not a directory in /usr/share/php/System.php on line 277
download directory "/build/buildd/php5-5.3.2/pear-build-download" is not writeable. Change download_dir config variable to a writeable dir
Error: cannot download "pear/Mail"
Warning: mkdir(): File exists in System.php on line 277
PHP Warning: mkdir(): File exists in /usr/share/php/System.php on line 277
Warning: mkdir(): Not a directory in System.php on line 277
PHP Warning: mkdir(): Not a directory in /usr/share/php/System.php on line 277
download directory "/build/buildd/php5-5.3.2/pear-build-download" is not writeable. Change download_dir config variable to a writeable dir
Error: cannot download "pear/Mail_Mime"
Warning: mkdir(): File exists in System.php on line 277
PHP Warning: mkdir(): File exists in /usr/share/php/System.php on line 277
Warning: mkdir(): Not a directory in System.php on line 277
PHP Warning: mkdir(): Not a directory in /usr/share/php/System.php on line 277
download directory "/build/buildd/php5-5.3.2/pear-build-download" is not writeable. Change download_dir config variable to a writeable dir
Error: cannot download "pear/Net_SMTP"
Warning: mkdir(): File exists in System.php on line 277
PHP Warning: mkdir(): File exists in /usr/share/php/System.php on line 277
Warning: mkdir(): Not a directory in System.php on line 277
PHP Warning: mkdir(): Not a directory in /usr/share/php/System.php on line 277
download directory "/build/buildd/php5-5.3.2/pear-build-download" is not writeable. Change download_dir config variable to a writeable dir
Error: cannot download "pear/Net_Socket"
Warning: mkdir(): File exists in System.php on line 277
PHP Warning: mkdir(): File exists in /usr/share/php/System.php on line 277
Warning: mkdir(): Not a directory in System.php on line 277
PHP Warning: mkdir(): Not a directory in /usr/share/php/System.php on line 277
download directory "/build/buildd/php5-5.3.2/pear-build-download" is not writeable. Change download_dir config variable to a writeable dir
Error: cannot download "pear/Auth_SASL"
Download failed
install failed
【问题讨论】:
-
试试 PEAR 提示你的东西:
--alldeps。所以pear install --alldeps Mail Mail_Mime -
感谢 Samuel,它仍然会溢出错误消息。
-
更新您的帖子并使用 --alldeps 调用显示消息