具体方法:
(推荐教程:php视频教程)
1、检查当前已安装的PHP包
yum list installed | grep php
2、如果有已安装的PHP包,先删除他们
立即学习“PHP免费学习笔记(深入)”;
yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64
3、配置CentOS 7.0的yum源
yum install epel-release rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
4、使用yum list命令查看可安装的包(Packege)
yum list --enablerepo=remi --enablerepo=remi-php56 | grep php
5、安装PHP5.6.x
yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof
6、查看已安装的PHP版本。
php --version
7、安装php-fpm
yum install --enablerepo=remi --enablerepo=remi-php56 php-fpm
(相关推荐:php培训)
8、重新Apache和php启动服务
$ sudo systemctl restart httpd $ sudo systemctl restart php-fpm
以上就是centos怎么安装php扩展的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号