php - 作曲家安装在 phpstorm 中不起作用
问题描述
我从 github 克隆了一个 laravel 存储库。我想在 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"
}
}
我尝试了这个解决方案,但它不起作用。问题是什么?
解决方案
您的 php.ini 设置中缺少扩展名。安装 ext-dom 的扩展,然后重新加载/重新启动服务器并再次运行“composer install”。
如果您使用带有 apt-get 的 Linux,那么您可以使用以下命令安装 ext-dom:
sudo apt-get install php-xml
推荐阅读
- go - 从 Mac x86 for M1 交叉编译 cgo 项目
- python - 如何在没有 SQL 注入的情况下改进 Postgre SQL (LIKE %)
- r - 将多个配对 t 检验的结果保存到 R 中的 CSV
- python - how to print first name, last name and birthday in python?
- ios - iOS 15 导航栏透明问题
- javascript - Javascript useCapture单击事件处理程序未在带有图像的按钮上触发
- stripe-payments - Stripe PaymentElement 组件:仅允许使用美国信用卡
- python - 在 Jupyter 笔记本中导入时出现 TQDM progress_apply 错误
- r - 创建一个虚拟对象,测试多列中的 na 值
- r - dummyVars() 和 predict() 的问题