LNMP 安裝遇到的問題筆記

由於最近修的資料庫課程作業有要使用 php + mysql 完成指定 project。
另外基於我是在 Linux 上做此份作業,Aok 電電 將 LNMP 推薦給我。

  • 一點小知識,LNMP 和 LEMP 都有人說,因為中間的 N 指的是 Nginx,且是 Eginx 的發音。

Outline

  1. 安裝流程
  2. 一些報錯情況
  3. phpMyAdmin in LNMP Stack on Arch Linux

Arch Linux 上安裝流程

基本上網路上都能夠找到許多教學流程,這裡不贅述。僅放上我有參考的安裝流程網站以供參考。

  1. Arch Linux 服务器安装 LNMP
  2. Install Nginx, MariaDB, PHP7 (LEMP) on Arch Linux Server in 2019

一些報錯情況

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
解法如下:

  1. 用 text editor 打開 /etc/nginx/nginx.conf
  2. 找到 http {} 的區域
  3. 增加 types_hash_max_sizeserver_names_hash_bucket_size
# /etc/nginx/nginx.conf
...

http {
    types_hash_max_size 4096;
    server_names_hash_bucket_size 128;
    ...
}
...
  1. 再次測試 nginx -t

2. [emerg] 103293#103293: open() “/run/nginx.pid” failed (13: Permission denied)

phpMyAdmin in LNMP Stack on Arch Linux