我从github克隆了一个拉拉储存库。我想在phpstorm上安装它,但是当我在终端环境中运行这个命令composer install时,出现了以下错误:
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- phpunit/phpunit 5.7.9 requires ext-dom * -> the requested PHP
...
- phpunit/phpunit 5.2.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- Installation request for phpunit/phpunit ^5.2 -> satisfiable by phpunit/phpunit[5..., 5.7.7, 5.7.8, 5.7.9].
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/20-sysvshm.ini
- /etc/php/7.0/cli/conf.d/20-tokenizer.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.这是我的composer.json文件:
{
"name": "cydrobolt/polr",
"description": "The Polr URL Shortener.",
"keywords": ["url-shortener", "url", "cms"],
"require": {
"php": ">=5.5.9",
"laravel/lumen-framework": "5.1.*",
"vlucas/phpdotenv": "~1.0",
"illuminate/mail": "~5.1",
"google/recaptcha": "~1.1"
},
"require-dev": {
"fzaninotto/faker": "~1.0",
"phpunit/phpunit": "^5.2",
"symfony/css-selector": "^3.0"
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/"
]
},
"autoload-dev": {
"classmap": [
"tests/"
]
},
"config": {
"preferred-install": "dist"
}
}我试过this solution,但它不起作用。有什么问题?
发布于 2018-11-30 07:41:21
您在php.ini设置中缺少一个扩展。安装ext-dom的扩展,然后重新加载/重新启动服务器,然后再次运行"composer“。
如果您在apt-get中使用Linux,那么可以使用以下命令安装ext-dom:
sudo apt-get install php-xmlhttps://stackoverflow.com/questions/53553092
复制相似问题