1,首先要更新荫源,不然肯定是老版本,一般都在5.6以下,但是PHP7都出来好久了,性能提升50%以上!
按照系统更新百胜源,我的是centos7,所以我运行下面的代码!
CentOS / RHEL 7.x:
- 1
- 2
如果是centos6,那么执行以下代码:
CentOS / RHEL 6.x:
- 1
- 2
然后就可以直接yum的安装php7.0了,可以安装的拓展如下:
yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64 yum install php70w-fpm
.安装PHP FPM
yum install php55w-fpm
yum install php56w-fpm
yum install php70w-fpm
就这一条命令,就可以安装了下面的拓展了!
php-api,php-bz2,php-calendar,php-ctype,php-curl,php-date,php-exif,php-fileinfo,php-filter,php-gmp,哈希,php-iconv,php-json,php-libxml,php-openssl,php-pcre,php-pecl-Fileinfo,php-pecl-phar,php-pecl-zip,php-reflection,php- shmop,php-simplexml,php-sockets,php-spl,php-tokenizer,php-zend-abi,php-zip,php-zlib
激动吧?别急,还有更牛的!一般都要安装的memcached,GD,MySQL的,等等是吧?
- 1
- 2
- 3
- 4
- 五
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 三十
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
譬如你要加装XML,那么可以直接,别怀疑就是这么简单:
- 1
2,检验一下成果:
查看一下PHP的版本:
- 1
查看一下PHP的拓展:
- 1
看到了吧?基本上会用的拓展都齐了吧?要啥自己去百胜一下就好了!再也不用去纠结各种依赖问题了!
使用国内yum源:http : //blog.youkuaiyun.com/zhezhebie/article/details/73484695
安装redis和memcached,直接yum安装即可:
- 1
memcached说明:http : //blog.youkuaiyun.com/zhezhebie/article/details/73471519
redis说明:http : //blog.youkuaiyun.com/zhezhebie/article/details/73470134
到这里还没结束,还需要配置一下php的配置文件和nginx的配置文件。
参考链接:http://php.net/manual/en/install.unix.nginx.php
webtatic参考链接:https://webtatic.com/packages/php70/
配置php解析.php文件:http:
//php.net/manual/en/install.unix.nginx.php