Centos7下LAMP安装及配置

2016-08-26  本文已影响350人  dotdiw
  1. 安装apache

     # yum -y install httpd 
     # systemctl start httpd.service 启动apache
     # systemctl stop httpd.service 停止apache
     # systemctl restart httpd.service 重启apache
     # systemctl enable httpd.service 设置apache开机启动 
    
  2. 安装MariaDB(centos7下默认安装)

  1. 安装PHP

# yum -y install php

# yum -y install php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash

# service mysql start

# systemctl restart httpd.service

测试PHP

# cd /var/www/html
# vi index.php #输入下面内容

<?php
phpinfo();
?>```

> 访问本机IP如下图所示恭喜你成功了




![](https://img.haomeiwen.com/i2137957/1b2d078f4fa48b17.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
上一篇下一篇

猜你喜欢

热点阅读