码迷,mamicode.com
首页 > 其他好文 > 详细

树莓派安装LAMP作为服务器

时间:2014-12-24 21:29:54      阅读:312      评论:0      收藏:0      [点我收藏+]

标签:

1、安装Apache

  先运行 sudo apt-get update 更新软件源

sudo apt-get install apache2

2、安装Mysql

sudo apt-get install mysql-server

  中间会出现输入 Mysql 的 "root" 用户的密码

3、安装PHP

sudo apt-get install php5
sudo apt-get install php5-mysql

4、输入你的机器地址测试效果,出现下图说明成功

  技术分享

5、把/var/www/index.html的内容清除,把下面这段代码添加到里面测试PHP是否正常工作

<?php
  print <<< EOT
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test successful</title>
</head>
<body>
<h1>Test successful</h1>
<p>Congratulations.</p>
<p>Your webserver and PHP are working.</p>
</body>
</html>
EOT;

?>

 出现下图说明成功

技术分享

 

来源:http://www.dosaw.com/huanjing/201308/shumeipai.html

树莓派安装LAMP作为服务器

标签:

原文地址:http://www.cnblogs.com/fengbohello/p/4183288.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!