我不知道以前有没有人经历过这种事。我试图安装PEAR邮件,以便我可以使用外部服务器发送电子邮件。但是,当我输入以下命令时,我一直收到错误消息:
:~# 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安装-alldeps邮件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
发布于 2014-02-13 20:35:05
似乎您的下载目录设置为/build/buildd/php5-5.3.2/,这是不可写的。
因此,您需要使用chmod使其可写:
# chmod -R 777 /build/buildd/php5-5.3.2/pear-build-download
甚至可能您的pear配置中的设置是您的系统以前某个版本遗留下来的,因此您可能需要重新创建该目录结构,然后执行chmod:
# mkdir -p /build/buildd/php5-5.3.2/pear-build-download
https://stackoverflow.com/questions/21752617
复制相似问题