This is an old revision of the document!
# fish shell brew install php@7.4 nginx pecl install zip libsodium # remove duplicated extension added in /usr/local/etc/php/7.4/php.ini
/opt/homebrew/etc/php/7.4/php-fpm.d/www.conf
; Start a new pool named 'www'.
; the variable $pool can be used in any directive and will be replaced by the
; pool name ('www' here)
[www]
user = _www
group = _www
listen = 127.0.0.1:9991
pm = ondemand
pm.max_children = 5
php_admin_value[memory_limit] = 1G
/opt/homebrew/etc/nginx/nginx.conf
worker_processes 1;
error_log /tmp/nginx-error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 8080;
server_name localhost;
location / {
root /Users/dcai/moodles/www;
index index.php index.html index.htm;
}
location ~ [^/]\.php(/|$) {
root /Users/dcai/moodles/www;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9991;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
include servers/*;
}