热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

ApacheServer(PHP+MySQL)onRaspberryPI_MySQL

ApacheServer(PHP+MySQL)onRaspberryPI
Apache

Raspberry PI origins from UK. It is a small (credit-card size) fully functional PC that installs Linux. To now, there are two models A and B of Raspberry PI. The A model has 1 USB, 256MB RAM and The enhanced B model has 2 USB, 512 RAM. Both are equipped with ARM 700MHz (single core) CPU, a SD card slot. The B model also comes with an onboard Ethernet interface. The Raspberry PI requires a micro USB power (5V, 1A) and it doesn’t have the power switch. It can be connected to monitor using HDMI or TV using composite video (RCA).

Apache Server (PHP + MySQL) on Raspberry PI

The SD card is used as the booting device ‘hard drive’, a minimal 4GB is required. You can download Linux images fromofficial website. And you can use Win32 Disk Imager to write the *.img to SD card.

Win32 Disk Imager for Raspberry PI

Insert the SD card into Raspberry PI.

Insert the SD card into Raspberry PI.

Power it on and on the first time a configuration program (sudo raspi-config) will run. Using this configuration tool, you’ll be able to set up SSH, keyboard, Memory Split between CPU and GPU etc.

sudo raspi-config Raspberry PI.

SSH Raspberry PI.

Run the following command to install Apache2 and PHP,

sudo apt-get install apache2 php5 libapache2-mod-php5
sudo apt-get install apache2 php5 libapache2-mod-php5

And as we know, PHP without MySQL database is pretty much useless, so we use the following command to install MySQL.

sudo apt-get install mysql-server mysql-client php5-mysql
sudo apt-get install mysql-server mysql-client php5-mysql

During the MySQL setup, you will be prompted for the root password for MySQL database, and after that we’ll be able to check if MySQL is properly installed.

MySQL on Raspberry PI.

You can runsudo service mysql restartandsudo service apache restartto restart the MySQL and apache server manually. And you can runphp -vto see the version of PHP.

pi@raspberrypi:~$ php -vPHP 5.4.4-14+deb7u9 (cli) (built: Apr 26 2014 21:57:41) Copyright (c) 1997-2012 The PHP GroupZend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
pi@raspberrypi:~$ php -vPHP 5.4.4-14+deb7u9 (cli) (built: Apr 26 2014 21:57:41) Copyright (c) 1997-2012 The PHP GroupZend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

The apache server will store aindex.htmlby default on/var/www/index.htmland if you open a browser and type in the IP address of the Raspberry PI, you will get something like this, which means your Raspberry PI now serves as a HTTP server.

Apache Server on Raspberry PI.

–EOF–

GD Star Rating
loading...

GD Star Rating
loading...

推荐阅读
  • 本文介绍了在开发Android新闻App时,搭建本地服务器的步骤。通过使用XAMPP软件,可以一键式搭建起开发环境,包括Apache、MySQL、PHP、PERL。在本地服务器上新建数据库和表,并设置相应的属性。最后,给出了创建new表的SQL语句。这个教程适合初学者参考。 ... [详细]
  • 本文介绍了在Mac上搭建php环境后无法使用localhost连接mysql的问题,并通过将localhost替换为127.0.0.1或本机IP解决了该问题。文章解释了localhost和127.0.0.1的区别,指出了使用socket方式连接导致连接失败的原因。此外,还提供了相关链接供读者深入了解。 ... [详细]
  • PHP组合工具以及开发所需的工具
    本文介绍了PHP开发中常用的组合工具和开发所需的工具。对于数据分析软件,包括Excel、hihidata、SPSS、SAS、MARLAB、Eview以及各种BI与报表工具等。同时还介绍了PHP开发所需的PHP MySQL Apache集成环境,包括推荐的AppServ等版本。 ... [详细]
  • Linux一键安装web环境全攻略
    摘自阿里云服务器官网,此处一键安装包下载:点此下载安装须知1、此安装包可在阿里云所有Linux系统上部署安装,此安装包包含的软件及版本为& ... [详细]
  • 腾讯安全平台部招聘安全工程师和数据分析工程师
    腾讯安全平台部正在招聘安全工程师和数据分析工程师。安全工程师负责安全问题和安全事件的跟踪和分析,提供安全测试技术支持;数据分析工程师负责安全产品相关系统数据统计和分析挖掘,通过用户行为数据建模为业务决策提供参考。招聘要求包括熟悉渗透测试和常见安全工具原理,精通Web漏洞,熟练使用多门编程语言等。有相关工作经验和在安全站点发表作品的候选人优先考虑。 ... [详细]
  • Tomcat安装与配置教程及常见问题解决方法
    本文介绍了Tomcat的安装与配置教程,包括jdk版本的选择、域名解析、war文件的部署和访问、常见问题的解决方法等。其中涉及到的问题包括403问题、数据库连接问题、1130错误、2003错误、Java Runtime版本不兼容问题以及502错误等。最后还提到了项目的前后端连接代码的配置。通过本文的指导,读者可以顺利完成Tomcat的安装与配置,并解决常见的问题。 ... [详细]
  • .htaccess文件 ... [详细]
  • Metasploit攻击渗透实践
    本文介绍了Metasploit攻击渗透实践的内容和要求,包括主动攻击、针对浏览器和客户端的攻击,以及成功应用辅助模块的实践过程。其中涉及使用Hydra在不知道密码的情况下攻击metsploit2靶机获取密码,以及攻击浏览器中的tomcat服务的具体步骤。同时还讲解了爆破密码的方法和设置攻击目标主机的相关参数。 ... [详细]
  • 在说Hibernate映射前,我们先来了解下对象关系映射ORM。ORM的实现思想就是将关系数据库中表的数据映射成对象,以对象的形式展现。这样开发人员就可以把对数据库的操作转化为对 ... [详细]
  • 本文详细介绍了Linux中进程控制块PCBtask_struct结构体的结构和作用,包括进程状态、进程号、待处理信号、进程地址空间、调度标志、锁深度、基本时间片、调度策略以及内存管理信息等方面的内容。阅读本文可以更加深入地了解Linux进程管理的原理和机制。 ... [详细]
  • 本文介绍了在Linux下安装Perl的步骤,并提供了一个简单的Perl程序示例。同时,还展示了运行该程序的结果。 ... [详细]
  • linux 禁止指定ip访问
    linux中如何禁止指定的ip访问呢?比如被别人暴力破解,被别人使用不同的密码尝试登录:所以我想直接禁用这些ip的访问.怎么办呢?解决方案:修改配置文件etchosts.deny把 ... [详细]
  • hadoop1.2.1文档中这样写:Nowcheckthatyoucansshtothelocalhostwithoutapassphrase:$sshlocalhostIfyou ... [详细]
  • 有关phpfgetss()函数的文章推荐10篇
    有关phpfgetss()函数的文章推荐10篇:了解如何使用PHP的各种文件函数。查看诸如fopen、fclose和feof之类的基本文件函数;了解诸如fgets、fgetss和f ... [详细]
  • 导读:在编程的世界里,语言纷繁多样,而大部分真正广泛流行的语言并不是那些学术界的产物,而是在通过自由发挥设计出来的。和那些 ... [详细]
author-avatar
小怡的宝_594
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有