刚开始用LINUX没什么经验,CentOS 6.5自带PHP5,当时不会删就留着了,然后安装了PHP7. 现在查看php -v结果显示的是PHP 5.6. 怎么让系统默认使用PHP7呢?
刚刚把PHP全删了“yum remove php*”,然后用YUM安装了PHP7,现在php -v显示是PHP 7了。
但是运行php-fpm的时候提示找不到文件。我又用yum --enablerepo=remi install php php-fpm 安装了一下php-fpm,执行后提示:
yum install php php-fpm php-mysql
Failed to set locale, defaulting to C
Loaded plugins: refresh-packagekit, security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.3.3-48.el6_8 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-48.el6_8 for package: php-5.3.3-48.el6_8.x86_64
--> Processing Dependency: php-cli(x86-64) = 5.3.3-48.el6_8 for package: php-5.3.3-48.el6_8.x86_64
---> Package php-fpm.x86_64 0:5.3.3-48.el6_8 will be installed
---> Package php-mysql.x86_64 0:5.3.3-48.el6_8 will be installed
--> Running transaction check
---> Package php-cli.x86_64 0:5.3.3-48.el6_8 will be installed
---> Package php-common.x86_64 0:5.3.3-48.el6_8 will be installed
--> Processing Conflict: php70w-common-7.0.15-1.w6.x86_64 conflicts php-common < 7.0
--> Finished Dependency Resolution
Error: php70w-common conflicts with php-common-5.3.3-48.el6_8.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
运行php-fpm依然提示“-bash: /usr/sbin/php-fpm: No such file or directory”
再试这个安装:
yum install php70-php-fpm.x86_64
Failed to set locale, defaulting to C
Loaded plugins: refresh-packagekit, security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php70-php-fpm.x86_64 0:7.0.15-1.el6.remi will be installed
--> Processing Dependency: php70-php-common(x86-64) = 7.0.15-1.el6.remi for package: php70-php-fpm-7.0.15-1.el6.remi.x86_64
--> Running transaction check
---> Package php70-php-common.x86_64 0:7.0.15-1.el6.remi will be installed
--> Processing Dependency: php70-php-json(x86-64) = 7.0.15-1.el6.remi for package: php70-php-common-7.0.15-1.el6.remi.x86_64
--> Processing Dependency: php70-runtime for package: php70-php-common-7.0.15-1.el6.remi.x86_64
--> Running transaction check
---> Package php70-php-json.x86_64 0:7.0.15-1.el6.remi will be installed
---> Package php70-runtime.x86_64 0:1.0-5.el6.remi will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
php70-php-fpm x86_64 7.0.15-1.el6.remi remi-safe 1.4 M
Installing for dependencies:
php70-php-common x86_64 7.0.15-1.el6.remi remi-safe 582 k
php70-php-json x86_64 7.0.15-1.el6.remi remi-safe 55 k
php70-runtime x86_64 1.0-5.el6.remi remi-safe 1.0 M
Transaction Summary
================================================================================
Install 4 Package(s)
Total download size: 3.0 M
Installed size: 8.0 M
Is this ok [y/N]: y
Downloading Packages:
http://rpms.remirepo.net/enterprise/6/safe/x86_64/php70-php-common-7.0.15-1.el6.remi.x86_64.rpm: [Errno 12] Timeout on http://rpms.remirepo.net/enterprise/6/safe/x86_64/php70-php-common-7.0.15-1.el6.remi.x86_64.rpm: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 3 seconds')
Trying other mirror.
(1/4): php70-php-common-7.0.15-1.el6.remi.x86_64.rpm | 582 kB 00:43
http://fr2.rpmfind.net/linux/remi/enterprise/6/safe/x86_64/php70-php-fpm-7.0.15-1.el6.remi.x86_64.rpm: [Errno 12] Timeout on http://fr2.rpmfind.net/linux/remi/enterprise/6/safe/x86_64/php70-php-fpm-7.0.15-1.el6.remi.x86_64.rpm: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 3 seconds')
Trying other mirror.
http://mirrors.mediatemple.net/remi/enterprise/6/safe/x86_64/php70-php-fpm-7.0.15-1.el6.remi.x86_64.rpm: [Errno 12] Timeout on http://mirrors.mediatemple.net/remi/enterprise/6/safe/x86_64/php70-php-fpm-7.0.15-1.el6.remi.x86_64.rpm: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 3 seconds')
Trying other mirror.
http://remi.mirrors.arminco.com/enterprise/6/safe/x86_64/php70-php-fpm-7.0.15-1.el6.remi.x86_64.rpm: [Errno 12] Timeout on http://remi.mirrors.arminco.com/enterprise/6/safe/x86_64/php70-php-fpm-7.0.15-1.el6.remi.x86_64.rpm: (28, 'connect() timed out!')
Trying other mirror.
(2/4): php70-php-fpm-7.0.15-1.el6.remi.x86_64.rpm | 1.4 MB 01:56
(3/4): php70-php-json-7.0.15-1.el6.remi.x86_64.rpm | 55 kB 00:06
http://remi.schlundtech.de/enterprise/6/safe/x86_64/php70-runtime-1.0-5.el6.remi.x86_64.rpm: [Errno 12] Timeout on http://remi.schlundtech.de/enterprise/6/safe/x86_64/php70-runtime-1.0-5.el6.remi.x86_64.rpm: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 3 seconds')
Trying other mirror.
(4/4): php70-runtime-1.0-5.el6.remi.x86_64.rpm | 1.0 MB 00:02
--------------------------------------------------------------------------------
Total 8.2 kB/s | 3.0 MB 06:16
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php70-runtime-1.0-5.el6.remi.x86_64 1/4
Installing : php70-php-common-7.0.15-1.el6.remi.x86_64 2/4
Installing : php70-php-json-7.0.15-1.el6.remi.x86_64 3/4
Installing : php70-php-fpm-7.0.15-1.el6.remi.x86_64 4/4
Unable to connect to dbus
Verifying : php70-php-json-7.0.15-1.el6.remi.x86_64 1/4
Verifying : php70-php-common-7.0.15-1.el6.remi.x86_64 2/4
Verifying : php70-php-fpm-7.0.15-1.el6.remi.x86_64 3/4
Verifying : php70-runtime-1.0-5.el6.remi.x86_64 4/4
Installed:
php70-php-fpm.x86_64 0:7.0.15-1.el6.remi
Dependency Installed:
php70-php-common.x86_64 0:7.0.15-1.el6.remi
php70-php-json.x86_64 0:7.0.15-1.el6.remi
php70-runtime.x86_64 0:1.0-5.el6.remi
Complete!
运行 php-fpm
显示
-bash: php-fpm: command not found
该怎么解决呢?
安装完php-fpm之后,最后提示
--> Finished Dependency Resolution
Error: php70w-common conflicts with php-common-5.3.3-48.el6_8.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
感觉是PHP5没删干净,跟PHP7冲突。 怎么删掉 php-common-5.3.3-48.el6_8.x86_64 ?
Start php-fpm: service php-fpm start
Use php command line mode: php executable file