2017-09-25 66 views
0

我試圖安裝包zendmail,但我得到了下面不能被解析到一個安裝包集合

[email protected]:~/Documents/strawberry$ composer require zendframework/zend-mail 
Using version ^2.8 for zendframework/zend-mail 
./composer.json has been updated 
Loading composer repositories with package information 
Updating dependencies (including require-dev) 
Your requirements could not be resolved to an installable set of packages. 

    Problem 1 
    - phpunit/php-code-coverage 4.0.8 requires ext-dom * -> the requested PHP extension dom is missing from your system. 
    - phpunit/php-code-coverage 4.0.8 requires ext-dom * -> the requested PHP extension dom is missing from your system. 
    - phpunit/php-code-coverage 4.0.8 requires ext-dom * -> the requested PHP extension dom is missing from your system. 
    - Installation request for phpunit/php-code-coverage (locked at 4.0.8) -> satisfiable by phpunit/php-code-coverage[4.0.8]. 

    To enable extensions, verify that they are enabled in your .ini files: 
    - /etc/php/7.0/cli/php.ini 
    - /etc/php/7.0/cli/conf.d/10-mysqlnd.ini 
    - /etc/php/7.0/cli/conf.d/10-opcache.ini 
    - /etc/php/7.0/cli/conf.d/10-pdo.ini 
    - /etc/php/7.0/cli/conf.d/20-calendar.ini 
    - /etc/php/7.0/cli/conf.d/20-ctype.ini 
    - /etc/php/7.0/cli/conf.d/20-exif.ini 
    - /etc/php/7.0/cli/conf.d/20-fileinfo.ini 
    - /etc/php/7.0/cli/conf.d/20-ftp.ini 
    - /etc/php/7.0/cli/conf.d/20-gettext.ini 
    - /etc/php/7.0/cli/conf.d/20-iconv.ini 
    - /etc/php/7.0/cli/conf.d/20-json.ini 
    - /etc/php/7.0/cli/conf.d/20-mysqli.ini 
    - /etc/php/7.0/cli/conf.d/20-pdo_mysql.ini 
    - /etc/php/7.0/cli/conf.d/20-phar.ini 
    - /etc/php/7.0/cli/conf.d/20-posix.ini 
    - /etc/php/7.0/cli/conf.d/20-readline.ini 
    - /etc/php/7.0/cli/conf.d/20-shmop.ini 
Linter 
Severity Provider Description Line 

錯誤,我不知道我應該與錯誤做。請幫我解決這個問題。

回答

0

您需要爲PHP安裝DOM功能(如圖中的錯誤信息phpunit/php-code-coverage 4.0.8 requires ext-dom * -> the requested PHP extension dom is missing from your system.)像一個基於Debian的機器

這看起來(從擴展的輸出)。 apt install php7.0-xml應該允許你繼續。

-1

在Zend框架2,通過默認的郵件包裹將在那裏,你可以使用這段代碼,

use Zend\Mail; 

$mail = new Mail\Message(); 
$mail->setBody('This is the text of the email.'); 
$mail->setFrom('[email protected]', 'Sender\'s name'); 
$mail->addTo('[email protected]', 'Name o. recipient'); 
$mail->setSubject('TestSubject'); 

$transport = new Mail\Transport\Sendmail(); 
$transport->send($mail); 

作參考,您可以訪問此頁面,https://framework.zend.com/manual/2.1/en/modules/zend.mail.introduction.html

相關問題