美文网首页我爱编程
centos7 搭建lamp(Apache PHP Mysql环

centos7 搭建lamp(Apache PHP Mysql环

作者: 风的追随者 | 来源:发表于2017-11-06 17:17 被阅读0次

    安装apache
    yum -y install httpd
    安装Php
    yum -y install php
    安装php-fpm
    yum -y install php-fpm
    安装Mysql
    yum -y install mysql
    安装 mysql-server
    wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
    rpm -ivh mysql-community-release-el7-5.noarch.rpm
    yum -y install mysql-community-server
    安装 php-mysql
    yum -y install php-mysql
    安装Apache扩展包
    yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql
    安装PHP扩展包
    yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-devel
    安装Mysql扩展包
    yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql
    配置Apache、mysql开机启动
    systemctl start httpd.service #启动apache
    systemctl stop httpd.service #停止apache
    systemctl restart httpd.service #重启apache
    systemctl enable httpd.service #设置apache开机启动
    重启对应服务
    service mysqld restart
    service php-fpm start
    service httpd restart
    更换高版本的php
    删除之前的 php 版本
    yum remove php* php-common
    rpm 安装 Php7 相应的 yum源
    rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
    直接yum安装php7
    yum install php70w

    相关文章

      网友评论

        本文标题:centos7 搭建lamp(Apache PHP Mysql环

        本文链接:https://www.haomeiwen.com/subject/jgglmxtx.html