首页 > 其他 > 详细

配置LAMP环境

时间:2020-04-02 23:01:40      阅读:74      评论:0      收藏:0      [点我收藏+]

  下载配置文件:
# yum install httpd mariadb-server mariadb php php-mysql  -y
 
  启动apache和数据库:
# systemctl start mariadb
# systemctl start httpd
 
  安装PHP运行环境:
# yum info php-mysql
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.lzu.edu.cn
 * epel: ftp.riken.jp
 * extras: mirrors.163.com
 * updates: mirrors.163.com
已安装的软件包
名称    :php-mysql
架构    :x86_64
版本    :5.4.16
发布    :46.el7
大小    :232 k
源    :installed
来自源:base
 
  启动MySQL:
# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.60-MariaDB MariaDB Server
 
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
 
Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.
 
MariaDB [(none)]> exit
Bye
 
  修改MySQL密码:
# /usr/bin/mysqladmin -u root password "*************"
 
  重新登陆MySQL:
# mysql -uroot -p
(只用# mysql 会报错)
ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)
 
  进入apache文件夹:
# cd /var/www/html/
 
  新建一个PHP文件:
# vim index.php
  1 <?php
  2      phpinfo();
  3 ?>
 
浏览器访问试验
e.g.  192.168.*.*

配置LAMP环境

原文:https://www.cnblogs.com/aslijitong/p/12622637.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!