LNMP 安裝遇到的問題筆記
由於最近修的資料庫課程作業有要使用 php + mysql 完成指定 project。
另外基於我是在 Linux 上做此份作業,Aok 電電 將 LNMP 推薦給我。
- 一點小知識,LNMP 和 LEMP 都有人說,因為中間的 N 指的是 Nginx,且是 Eginx 的發音。
Outline
- 安裝流程
- 一些報錯情況
- phpMyAdmin in LNMP Stack on Arch Linux
Arch Linux 上安裝流程
基本上網路上都能夠找到許多教學流程,這裡不贅述。僅放上我有參考的安裝流程網站以供參考。
一些報錯情況
1. types_hash_max_size: 1024 or types_hash_bucket_size: 64; …
$ nginx -t
... [warn] 97437#97437: could not build optimal types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_size: 64; ignoring types_hash_bucket_size
我參考了這篇:https://blog.csdn.net/weixin_36349646/article/details/102686936
解法如下:
- 用 text editor 打開
/etc/nginx/nginx.conf
- 找到
http {}
的區域 - 增加
types_hash_max_size
和server_names_hash_bucket_size
# /etc/nginx/nginx.conf
...
http {
types_hash_max_size 4096;
server_names_hash_bucket_size 128;
...
}
...
- 再次測試
nginx -t
2. [emerg] 103293#103293: open() “/run/nginx.pid” failed (13: Permission denied)
這裡先提,修正上面第一個問題後,我
nginx -t
時只有報這個錯誤,如下圖:$ nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok 2023/05/19 17:29:39 [emerg] 103293#103293: open() "/run/nginx.pid" failed (13: Permission denied) nginx: configuration file /etc/nginx/nginx.conf test failed
目前我尚未找到更好的解法,僅在測試時加上 sudo 作為 workaround。
這裡上一些有參考過的網站。
phpMyAdmin in LNMP Stack on Arch Linux
- 如果已經 install nginx 並調校好
nginx.conf
基本上從下面這篇文章的 Step 4 開始即可 - How to Install LEMP Stack on Arch Linux
- 本文連結:https://blog.subarya.me/2023/05/19/LNMP%20%E5%AE%89%E8%A3%9D%E9%81%87%E5%88%B0%E7%9A%84%E5%95%8F%E9%A1%8C%E7%AD%86%E8%A8%98/
- 版權聲明:本Blog所有文章除了特別聲明外,均默認採用 許可之協議。