Apache Server (PHP + MySQL) on Raspberry PI_MySQL

php中文网
发布: 2016-06-01 13:14:43
原创
1322人浏览过

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.

立即学习PHP免费学习笔记(深入)”;

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,

Uniform Server
Uniform Server

Uniform Server是一个免费的轻量级WAMP服务器解决方案,适用于Windows。采用模块化设计方法构建,包括最新版本的Apache、MySQL或MariaDB、PHP(支持版本切换)、phpMyAdmin或Adminer。无需安装!无需注册表垃圾!只需解压并启动!-------注意:Uniform Server的最新版本需要**64位版本**的Windows。-------

Uniform Server 7
查看详情 Uniform Server
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...

PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号