我收到以下错误,有人可以描述吗?我使用Laravel 4和composer作为依赖管理器。我尝试了几次这样做,在各种论坛上搜索并没有解决这个问题。如果有人能够研究这个问题并建议解决方案,我将不胜感激。
Your requirements could not be resolved to an installable set of packages.
Problem 1
- maatwebsite/excel v1.3.7 requires phpoffice/phpexcel ~1.8.0 -> satisfiable by phpoffice/phpexcel[1.8.1, 1.8.0].
- maatwebsite/excel 1.3.2 requires phpoffice/phpexcel ~1.8.0 -> satisfiable by phpoffice/phpexcel[1.8.1, 1.8.0].
- maatwebsite/excel v1.3.0 requires phpoffice/phpexcel ~1.8.0 -> satisfiable by phpoffice/phpexcel[1.8.1, 1.8.0].
- maatwebsite/excel v1.3.1 requires phpoffice/phpexcel ~1.8.0 -> satisfiable by phpoffice/phpexcel[1.8.1, 1.8.0].
- maatwebsite/excel v1.3.3 requires phpoffice/phpexcel ~1.8.0 -> satisfiable by phpoffice/phpexcel[1.8.1, 1.8.0].
- maatwebsite/excel v1.3.4 requires phpoffice/phpexcel ~1.8.0 -> satisfiable by phpoffice/phpexcel[1.8.1, 1.8.0].
- maatwebsite/excel v1.3.5 requires phpoffice/phpexcel ~1.8.0 -> satisfiable by phpoffice/phpexcel[1.8.1, 1.8.0].
- maatwebsite/excel v1.3.6 requires phpoffice/phpexcel ~1.8.0 -> satisfiable by phpoffice/phpexcel[1.8.1, 1.8.0].
- maatwebsite/excel v1.3.7 requires phpoffice/phpexcel ~1.8.0 -> satisfiable by phpoffice/phpexcel[1.8.1, 1.8.0].
- phpoffice/phpexcel 1.8.1 requires ext-xml * -> the requested PHP extension xml is missing from your system.
- phpoffice/phpexcel 1.8.0 requires ext-xml * -> the requested PHP extension xml is missing from your system.
- phpoffice/phpexcel 1.8.1 requires ext-xml * -> the requested PHP extension xml is missing from your system.
- Installation request for maatwebsite/excel ~1.3 -> satisfiable by maatwebsite/excel[1.3.2, v1.3.0, v1.3.1, v1.3.3, v1.3.4, v1.3.5, v1.3.6, v1.3.7].
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php.ini
- /etc/php.d/20-bz2.ini
- /etc/php.d/20-calendar.ini
- /etc/php.d/20-ctype.ini
- /etc/php.d/20-curl.ini
- /etc/php.d/20-exif.ini
- /etc/php.d/20-fileinfo.ini
- /etc/php.d/20-ftp.ini
- /etc/php.d/20-gettext.ini
- /etc/php.d/20-iconv.ini
- /etc/php.d/20-mcrypt.ini
- /etc/php.d/20-mysqlnd.ini
- /etc/php.d/20-pdo.ini
- /etc/php.d/20-phar.ini
- /etc/php.d/20-sockets.ini
- /etc/php.d/20-sqlite3.ini
- /etc/php.d/20-tokenizer.ini
- /etc/php.d/30-mysql.ini
- /etc/php.d/30-mysqli.ini
- /etc/php.d/30-pdo_mysql.ini
- /etc/php.d/30-pdo_sqlite.ini
- /etc/php.d/40-json.ini
- /etc/php.d/40-zip.ini
这个问题很老,我是stackoverflow的新手。我以非常错误的格式发布了这个,这就是为什么我得到了-1的声誉。这个问题已经解决,我正在编辑这个问题只是为了很好地格式化这个问题并提高可读性。
答案 0 :(得分:7)
错误说明:the requested PHP extension xml is missing from your system
主机上未安装或禁用PHP-XML扩展。您需要先启用或安装扩展程序,然后才能使用需要它的程序包。
如果已安装,请启用php.ini文件中的扩展名。如果未安装,请根据操作系统的需要安装扩展。
要让Ubuntu安装此扩展程序,您需要运行sudo apt-get install php-xml
,对于Google需要安装的其他操作系统。
答案 1 :(得分:1)
在我的情况下const obj = {
"a": [5,1,2],
"b": [4,0,3],
"c": [1,1,4]
};
const convert = (obj) => {
let res = [];
const keys = Object.keys(obj);
if (!keys.length) return [];
for (let i = 0; i < obj[keys[0]].length; i++) {
let nextObj = {};
keys.forEach(key => {
nextObj[key] = obj[key][i];
});
res.push(nextObj);
}
return res;
}
console.log(convert(obj))
已经安装。
php-xml
所以,我必须安装root@shashank-dbserver /# apt-get install php-xml
Reading package lists... Done
Building dependency tree
Reading state information... Done
php-xml is already the newest version.
php-xml set to manually installed.
代替&amp;我的错误消失了。
php5.6-xml
在此之后,root@shashank-dbserver /# apt-get install php5.6-xml
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
zlib1g-dev
Use 'apt-get autoremove' to remove it.
The following NEW packages will be installed:
php5.6-xml
命令运行得很好。