phpexiftool/exiftoolのインストール時に、PHP extension domが無くて依存解決エラー
[Ubuntu]
仮想マシンHomesteadにおいて
問題なく動作していたが、
[CentOS 7]
本番環境においては、
拡張エラーが出たので、その時の対処法をメモ。
# composer require phpexiftool/exiftool Using version ^10.16 for phpexiftool/exiftool ./composer.json has been updated 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 4.8.36 requires ext-dom * -> the requested PHP extension dom is missing from your system. - phpunit/phpunit 4.8.36 requires ext-dom * -> the requested PHP extension dom is missing from your system. - Installation request for phpunit/phpunit (installed at 4.8.36, required as ~4.0) -> satisfiable by phpunit/phpunit[4.8.36]. To enable extensions, verify that they are enabled in your .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-gd.ini - /etc/php.d/20-gettext.ini - /etc/php.d/20-iconv.ini - /etc/php.d/20-json.ini - /etc/php.d/20-mbstring.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-mysqli.ini - /etc/php.d/30-pdo_mysql.ini - /etc/php.d/30-pdo_sqlite.ini You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode. Installation failed, reverting ./composer.json to its original content.
--enablerepoオプションで解決
[参照] http://ryu-go.hatenablog.com/entry/2017/06/13/182329
# yum -y install --enablerepo=remi-php71 php-xml Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile
httpd再起動で反映。phpexiftool/exiftool
# systemctl restart httpd # composer require phpexiftool/exiftool Using version ^10.16 for phpexiftool/exiftool ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 1 install, 0 updates, 0 removals - Installing phpexiftool/exiftool (10.16): Downloading (100%) Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested. Writing lock file Generating autoload files Carbon 1 is deprecated, see how to migrate to Carbon 2. https://carbon.nesbot.com/docs/#api-carbon-2 You can run './vendor/bin/upgrade-carbon' to get help in updating carbon and other frameworks and libraries that depend on it. > Illuminate\Foundation\ComposerScripts::postUpdate > php artisan optimize Generating optimized class loader