无法找到包 php7.0-phpoffice/phpspreadsheet

Unable to locate package php7.0-phpoffice/phpspreadsheet

我有 "Ubuntu 16.04 LTS" OS 并尝试使用命令安装 phpoffice/phpspreadsheet:

sudo apt-get install php7.0-phpoffice/phpspreadsheet

收到错误消息:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package php7.0-phpoffice
E: Couldn't find any package by glob 'php7.0-phpoffice'
E: Couldn't find any package by regex 'php7.0-phpoffice'

Ubuntu » Packages » Package Search Results:

php7.0-phpoffice/phpspreadsheet

Sorry, your search gave no results

.

PHP Package Repository:

php7.0-phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

composer require phpoffice/phpspreadsheet

需要扩展名 gd,但我在 php7.0 版本中找不到该包。以下命令用于安装扩展gd.

sudo apt-add-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0
sudo apt-get install php7.0-gd

然后我们可以使用 composer require phpoffice/phpspreadsheet