[PHPUnit] 解決CentOS7 底下使用 php56 安裝 XDEBUG 衝突問題
安裝XDEBUG的時候遇到PHP的一些環境衝突
sudo yum install php-xdebug
...
Resolving Dependencies
--> Running transaction check
---> Package php-pecl-xdebug.x86_64 0:2.2.7-1.el7 will be installed
--> Processing Dependency: php(zend-abi) = 20100525-64 for package: php-pecl-xdebug-2.2.7-1.el7.x86_64
--> Processing Dependency: php(api) = 20100412-64 for package: php-pecl-xdebug-2.2.7-1.el7.x86_64
--> Processing Dependency: /usr/bin/pecl for package: php-pecl-xdebug-2.2.7-1.el7.x86_64
--> Processing Dependency: /usr/bin/pecl for package: php-pecl-xdebug-2.2.7-1.el7.x86_64
--> Running transaction check
---> Package php-common.x86_64 0:5.4.16-42.el7 will be installed
---> Package php-pear.noarch 1:1.9.4-21.el7 will be installed
--> Processing Conflict: php56w-common-5.6.30-1.w7.x86_64 conflicts php-common < 5.6
--> Finished Dependency Resolution
Error: php56w-common conflicts with php-common-5.4.16-42.el7.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
首先先查看安裝過的檔案
想查看安裝過的檔案 可以下以下的指令:
rpm -qa|grep php
yum list |grep php
[eric_tu@localhost eric_tu]$ rpm -qa|grep php
php56w-pdo-5.6.30-1.w7.x86_64
php56w-gd-5.6.30-1.w7.x86_64
php56w-mysql-5.6.30-1.w7.x86_64
php56w-mbstring-5.6.30-1.w7.x86_64
php56w-common-5.6.30-1.w7.x86_64
php56w-mcrypt-5.6.30-1.w7.x86_64
php56w-intl-5.6.30-1.w7.x86_64
php56w-5.6.30-1.w7.x86_64
php56w-xml-5.6.30-1.w7.x86_64
php56w-fpm-5.6.30-1.w7.x86_64
php56w-process-5.6.30-1.w7.x86_64
php56w-soap-5.6.30-1.w7.x86_64
php56w-cli-5.6.30-1.w7.x86_64
php56w-devel-5.6.30-1.w7.x86_64
php56w-opcache-5.6.30-1.w7.x86_64
安裝過程,環境有衝突。
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.vpshosting.com.hk
* epel: ftp.cuhk.edu.hk
* extras: mirror.vpshosting.com.hk
* updates: mirror.vpshosting.com.hk
* webtatic: sp.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php-pecl-xdebug.x86_64 0:2.2.7-1.el7 will be installed
--> Processing Dependency: php(zend-abi) = 20100525-64 for package: php-pecl-xdebug-2.2.7-1.el7.x86_64
--> Processing Dependency: php(api) = 20100412-64 for package: php-pecl-xdebug-2.2.7-1.el7.x86_64
--> Processing Dependency: /usr/bin/pecl for package: php-pecl-xdebug-2.2.7-1.el7.x86_64
--> Processing Dependency: /usr/bin/pecl for package: php-pecl-xdebug-2.2.7-1.el7.x86_64
--> Running transaction check
---> Package php-common.x86_64 0:5.4.16-42.el7 will be installed
---> Package php-pear.noarch 1:1.9.4-21.el7 will be installed
--> Processing Conflict: php56w-common-5.6.30-1.w7.x86_64 conflicts php-common < 5.6
--> Finished Dependency Resolution
Error: php56w-common conflicts with php-common-5.4.16-42.el7.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
解決
找到的方法大部分都是覆蓋掉PHP版本,
剛剛印出的rpm裡的套件名都帶php56,
所以用 php56w xdebug 去找找看。
找到這個網站,上面有所有相依的套件再去查xdebug相關的。
https://webtatic.com/packages/php56/
找到 php56w-pecl-xdebug 。
裝下去!
剛剛印出的rpm裡的套件名都帶php56,
所以用 php56w xdebug 去找找看。
找到這個網站,上面有所有相依的套件再去查xdebug相關的。
https://webtatic.com/packages/php56/
找到 php56w-pecl-xdebug 。
裝下去!
sudo yum install php56w-pecl-xdebug
...
確認看看…
[eric_tu@localhost eric_tu]$ rpm -qa|grep php
php56w-pdo-5.6.30-1.w7.x86_64
php56w-gd-5.6.30-1.w7.x86_64
php56w-mysql-5.6.30-1.w7.x86_64
php56w-mbstring-5.6.30-1.w7.x86_64
php56w-common-5.6.30-1.w7.x86_64
php56w-mcrypt-5.6.30-1.w7.x86_64
php56w-intl-5.6.30-1.w7.x86_64
php56w-5.6.30-1.w7.x86_64
php56w-xml-5.6.30-1.w7.x86_64
php56w-fpm-5.6.30-1.w7.x86_64
php56w-process-5.6.30-1.w7.x86_64
php56w-soap-5.6.30-1.w7.x86_64
php56w-pecl-xdebug-2.5.3-1.w7.x86_64
php56w-cli-5.6.30-1.w7.x86_64
php56w-devel-5.6.30-1.w7.x86_64
php56w-opcache-5.6.30-1.w7.x86_64
php56w-pear-1.10.1-1.w7.noarch
到symfony底下運行,打開phpunit -h 找到用法,可以開始看覆蓋率報告囉!
vendor/bin/phpunit -h
vendor/bin/phpunit --coverage-html ./web/report.html
links report.html/index.html
http://test123/report.html/Controller/DefaultController.php.html
留言
張貼留言