Apache + MySql + Php.
Apache: It is the first web server software in the world.
It can run on almost all widely used computer platforms. Because of its cross platform and security, it is the most popular Web server software
MySQL: It is a relational database management system, developed by MySQL AB in Sweden. It is the most popular relational database management system, and MySQL is one of the best RDBMS (Relational Database Management System) applications in terms of WEB applications.
PHP: (Foreign name: Hypertext Preprocessor, Chinese name: "Hypertext Preprocessor") is a general open source scripting language. The syntax absorbs the characteristics of C language, Java and Perl, is easy to learn and widely used, and is mainly applicable to the field of Web development.
Raspberry Pie can install this LAMP series, but Apache and MySql are too heavy for raspberry Pie, a small machine, mainly because it consumes more memory, is slow, and takes up a large disk (about 200M). You can choose to install a lightweight Web server:
nginx + php + sqlite
nginx: It is a lightweight web server, a lightweight web server/reverse proxy server and email (IMAP/POP3) proxy server. The concurrency of nginx is really good among web servers of the same type.
SQLite: It is a lightweight database and an ACID compliant relational database management system. Its design goal is embedded, and it has been used in many embedded products. It occupies very low resources. In embedded devices, it may only need hundreds of K of memory.
Apache + MySql + Php.
1. Install Apache
Apache can be installed with the following command
sudo apt-get install apache2
The default path of Apache is/var/www/
The configuration file path is:/etc/apache2/
You can modify the listening port number through sudo vi/etc/apache2/ports.conf
Restarting the service takes effect: sudo service apache2 restart
2. Install MySQL
sudo apt-get install mysql-server
During installation, a prompt will appear asking you to enter a password.
This password is the password of the MySQL root user.
3. Install PHP
Enter the following command to install PHP 5 and the libraries required for PHP to access the MySQL database.
sudo apt-get install php7.0
sudo apt-get install php7.0-mysql
4. Test
After installation, you can enter the IP or domain name of your router in the browser, and then you can visit your website.
You should see a page displaying "It works", but nothing else.
Create a/var/www/index.php
<? php
2、 Nginx+php+sqlite
1. Install nginx web server (about 6MB)
sudo apt-get install nginx
2. Start nginx
sudo /etc/init.d/nginx start
The www root directory of nginx is in/usr/share/nginx/www by default
3. Modify the configuration file of nginx
sudo vi /etc/nginx/sites-available/default
1) Note the following options:
listen 8080; ## listen for ipv4; this line is default and implied
//The listening port number can be changed here if it conflicts with other software
root /usr/share/nginx/www;
//Nginx default path html path
index index.html index.htm index.php ;
//For the default page type searched by nginx, we can add an index.php
2) PHP script support (PHP scripts cannot be recognized without these settings)
Find the definition section of php, remove the comments on these lines, and the modified contents are as follows
location ~ .php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
There are some other definitions in the php section. Do not touch them, such as:
# fastcgi_split_path_info …
# fastcgi_pass 127.0.0.1:9000
4) Install php and sqlite (about 3MB)
sudo apt-get install php7.0-fpm php7.0-sqlite
5) Reload the configuration of nginx
sudo /etc/init.d/nginx reload
6) Test html
Access the raspberry pie through the IE of the host, and you can see the home page (indicating that the Web server has started normally)
7) Test php
Generate a php file in raspberry pie
sudo vi /usr/share/nginx/www/index.php
Enter the following in the file
Save Exit