centos 7 安装 apache,php,并支持mongodb扩展

前端之家收集整理的这篇文章主要介绍了centos 7 安装 apache,php,并支持mongodb扩展前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

一.安装apache

yum install httpd

可能会用到的:

systemctl start httpd.service #启动apache

systemctl stop httpd.service #停止apache

systemctl restart httpd.service #重启apache

systemctl enable httpd.service #设置apache开机启动


二. 安装PHP

yum install PHP

yum install PHP-devel


三.支持mongodb

可能需要openssl扩展

yum install openssl openssl-devel

pecl install mongodb 从 http://pecl.PHP.net/package/mongodb

pecl install mongo 从 http://pecl.PHP.net/package/mongo


echo "extension=mongodb.so" >> `PHP --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`

或者(对应版本)echo "extension=mongo.so" >> `PHP --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`

systemctl restart httpd.service

ok了

原文链接:https://www.f2er.com/centos/381129.html

猜你在找的CentOS相关文章