Set up LNMP environment on Raspberry Pi

藏色散人
Release: 2023-04-07 19:54:01
forward
2658 people have browsed it

Build Nginx MariaDB PHP7.0 environment on Raspberry Pi 3rd generation model B.

Nginx

First download the source code of Nginx/PCRE/OpenSSL. I won’t go into the download process. PCRE requires version 1.x, and OpenSSL does not require fips version. After downloading, unzip it. I did it in the /tmp directory.

Install PCRE first, enter the PCRE source code directory, execute ./configure, if there are no errors, then execute make && sudo make install. After completion, enter the Nginx source code directory and execute the command

./configure --prefix=/etc/nginx --with-pcre=/pcre源码目录 --sbin-path=/usr/sbin/nginx --with-http_ssl_module --with-openssl=/openssl源码目录
Copy after login

The meaning of these parameters:

--prefix is ​​the Nginx installation directory, --sbin-path is the location of the Nginx launcher, --with-http_ssl_module Install the SSL module.

Then execute make && sudo make install. After the installation is complete, execute sudo nginx -v to view the Nginx version.

PHP

Install PHP7.0 here.

First modify the source list.

sudo vim /etc/apt/sources.list, add a line:

deb http://mirrordirector.raspbia... stretch main contrib non-free rpi
Copy after login

Then create a file sudo vi /etc/apt/preferences, add the following content:

Package: *
Pin: release n=jessie
Pin-Priority: 600
Copy after login

Execute sudo apt-get update to update the source. You can start the installation

sudo apt-get install -t stretch php7.0 php7.0-curl php7.0-gd php7.0-fpm php7.0-cli php7.0-opcache php7.0-mbstring php7.0-xml php7.0-zip
Copy after login

After installation, execute php -v to check the version.

MySQL/MariaDB

What I installed here is MariaDB, which is exactly the same as MySQL. It is installed directly with the apt-get command. You can execute the following command to find the version that can be installed

sudo apt-cache search mariadb
Copy after login

After finding the required version, directly use the sudo apt-get install command to install it.

At this point, the configuration of the Web operating environment is completed.

The above is the detailed content of Set up LNMP environment on Raspberry Pi. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!