日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

树莓派lnmp安装mysql_在树莓派上安装 LNMP

發布時間:2025/3/11 数据库 14 豆豆
生活随笔 收集整理的這篇文章主要介紹了 树莓派lnmp安装mysql_在树莓派上安装 LNMP 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

樹莓派支持安裝非常多的操作系統,如官方所展示:

這里我選擇了推薦的 Raspbian 系統,它基于 Debian,這就意味著我可以按照 Debian 的方式來安裝軟件。

一、安裝 Nginx

0、先將系統更新到最新狀態

$ sudo apt-get update && sudo apt-get upgrade

1、下載 nginx

$ sudo apt-get install nginx -y

2、啟動 Nginx 服務

$ sudo /etc/init.d/nginx start

3、打開樹莓派的 IP 地址

[ ok ] Starting nginx (via systemctl): nginx.service.

二、安裝 PHP

配合Nginx使用時,PHP的安裝包和Apache2配合使用稍微有些不同,PHP以FastCGI接口方式運行,因此我們需要安裝PHP FPM包。

1、下載 PHP:

$ sudo apt-get install php5-fpm -y

2、在 Nginx 啟動 PHP:

$ cd /etc/nginx

$ sudo vim sites-enabled/default

找到

index index.html index.htm;

添加 index.php

index index.php index.html index.htm;

往下滾找到

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

#

# location ~ \.php$ {

去除 # 注釋改成:

location ~ \.php$ {

include snippets/fastcgi-php.conf;

fastcgi_pass unix:/var/run/php5-fpm.sock;

}

它應該看起來像:

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

#

location ~ \.php$ {

include snippets/fastcgi-php.conf;

# With php5-cgi alone:

# fastcgi_pass 127.0.0.1:9000;

# With php5-fpm:

fastcgi_pass unix:/var/run/php5-fpm.sock;

}

重新加載配置文件:

$ sudo /etc/init.d/nginx reload

3、啟動 PHP:

$ sudo service php5-fpm start

三、測試 PHP

1、重命名文件

$ cd /var/www/html/

$ sudo mv index.nginx-debian.html index.php

2、編輯文件

$ sudo vim index.php

3、在合適的地方填入:

4、觀看效果:

四、安裝 MySQL待續

翻譯自:

總結

以上是生活随笔為你收集整理的树莓派lnmp安装mysql_在树莓派上安装 LNMP的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。