今天新部署一台服务器,将之前的项目copy一份过去,想要跑起来。在安装composer后使用install时报错
[root@ecs-1ada-0317666 yedan_school]# composer install
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/phpunit 5.7.9 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.8 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.7 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.6 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.27 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.26 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.25 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.24 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.23 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.22 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.21 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.20 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.19 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.18 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.17 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.16 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.15 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.14 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.13 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.12 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.11 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.10 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- Installation request for phpunit/phpunit ~5.7 -> satisfiable by phpunit/phpunit[5.7.0, 5.7.1, 5.7.10, 5.7.11, 5.7.12, 5.7.13, 5.7.14, 5.7.15, 5.7.16, 5.7.17, 5.7.18, 5.7.19, 5.7.2, 5.7.20, 5.7.21, 5.7.22, 5.7.23, 5.7.24, 5.7.25, 5.7.26, 5.7.27, 5.7.3, 5.7.4, 5.7.5, 5.7.6, 5.7.7, 5.7.8, 5.7.9].
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php.ini
- /etc/php.d/bcmath.ini
- /etc/php.d/bz2.ini
- /etc/php.d/calendar.ini
- /etc/php.d/ctype.ini
- /etc/php.d/curl.ini
- /etc/php.d/exif.ini
- /etc/php.d/fileinfo.ini
- /etc/php.d/ftp.ini
- /etc/php.d/gd.ini
- /etc/php.d/gettext.ini
- /etc/php.d/gmp.ini
- /etc/php.d/iconv.ini
- /etc/php.d/json.ini
- /etc/php.d/mbstring.ini
- /etc/php.d/mysqli.ini
- /etc/php.d/pdo.ini
- /etc/php.d/pdo_mysql.ini
- /etc/php.d/pdo_sqlite.ini
- /etc/php.d/phar.ini
- /etc/php.d/shmop.ini
- /etc/php.d/simplexml.ini
- /etc/php.d/sockets.ini
- /etc/php.d/sqlite3.ini
- /etc/php.d/tokenizer.ini
- /etc/php.d/xml.ini
- /etc/php.d/zip.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
在网上找了问题所在,知道是composer包里有扩展依赖与php扩展,然后这个PHP扩展(yum install php71w-xml)没装。(php版本7.1)
但是很不幸的是我自以为对yum很了解,用了yum list | grep xml后发现有php71w-xml,以为是我本地已经有这个扩展了,所以一直没有管这个答案,一直找其他原因。后来才发现yum list的意思是列出所有可安装的软件包。真正列出本地已安装的软件包的其实是命令yum list installed。因此要牢记一下免得下次再犯同样的错误!!
附(网址来源https://www.cnblogs.com/AganRun/p/8118339.html):
1.使用YUM查找软件包
命令:yum search
2.列出所有可安装的软件包
命令:yum list
3.列出所有可更新的软件包
命令:yum list updates
4.列出所有已安装的软件包
命令:yum list installed