日期 2019年9月 下的文章

树莓派Nginx + PHP7.3 + mysql


在 Pi 的终端运行以下命令

sudo apt-get update
php扩展可以一个一个安装,缺哪个按如下方式安装即可
sudo apt-get install php7.3-fpm php7.3-cli php7.3-curl php7.3-gd php7.3-cgi
sudo apt-get install php7.3-mysqli
sudo service php7.3-fpm restart

sudo apt-get install nginx
sudo service nginx start

修改nginx配置

sudo nano /etc/nginx/sites-available/default

重启nginx
sudo service nginx restart

安装mysql

sudo apt install mariadb-server
mysql添加用户密码
create user pi@localhost identified by 'raspberry';
grant all privileges on *.* to pi@localhost identified by 'raspberry';
flush privileges; 

参考:http://shumeipai.nxez.com/2018/04/25/install-pi-dashboard-with-nginx-php7-on-pi.html