# yum-config-manager --enable remi-php71 [Default]
# yum install php php-common php-fpm
一般來說開啟了remi-php71之後
再繼續安裝php會直接抓remi去安裝php71 但是我遇到的狀況系統自動抓了預設的repo
安裝的是php5.4,沒有照我的想法安裝php71
然後我以其他方式安裝php71跟php56之後
查php -v -bash: php: command not found
php71 -v跟php56 -v都查的到版本
那這樣代表的是不是系統沒有預設的php版本? 因為無法辨識出到底要找php71或php56
要使用到php一定要寫程式去找php的程式路徑
系統預設的安裝路徑裡面是沒有php安裝過的
希望可以釐清預設php的關係
先移掉你系統中的 phpsudo yum remove $(rpm -qa | fgrep php)
然後安裝時,直接指定你要裝的版本sudo yum install php-7.1 php-common-7.1 php-fpm-7.1
這錯誤不知道有沒有得解
Loaded plugins: langpacks, priorities, update-motd
186 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package php-mysqlnd.x86_64 0:5.4.16-43.amzn2.0.1 will be installed
--> Processing Dependency: php-pdo(x86-64) = 5.4.16-43.amzn2.0.1 for package: php-mysqlnd-5.4.16-43.amzn2.0.1.x86_64
--> Running transaction check
---> Package php-pdo.x86_64 0:5.4.16-43.amzn2.0.1 will be installed
--> Processing Dependency: php-common(x86-64) = 5.4.16-43.amzn2.0.1 for package: php-pdo-5.4.16-43.amzn2.0.1.x86_64
--> Finished Dependency Resolution
Error: Package: php-pdo-5.4.16-43.amzn2.0.1.x86_64 (amzn2-core)
Requires: php-common(x86-64) = 5.4.16-43.amzn2.0.1
Installed: php-common-7.1.13-1.el7.remi.x86_64 (@remi-php71)
php-common(x86-64) = 7.1.13-1.el7.remi
Available: php-common-5.4.16-43.amzn2.x86_64 (amzn2-core)
php-common(x86-64) = 5.4.16-43.amzn2
Available: php-common-5.4.16-43.amzn2.0.1.x86_64 (amzn2-core)
php-common(x86-64) = 5.4.16-43.amzn2.0.1
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
一樣是版本衝突。
請在你要裝的套件上加上版本,強制 yum 裝某個版本