This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| php:macos-installation [2021-02-28] – dcai | php:macos-installation [2021-10-31] (current) – dcai | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===== PHP 7.4 macOS installation ===== | ||
| + | |||
| + | |||
| + | ==== install packages ==== | ||
| < | < | ||
| - | # fish shell | + | brew install php@7.4 |
| - | brew install php@7.4 | + | # pecl install zip libsodium |
| - | pecl install zip libsodium | + | |
| # remove duplicated extension added in / | # remove duplicated extension added in / | ||
| + | brew link php@7.4 | ||
| + | brew link postgresql@12 | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== setup postgres ==== | ||
| + | < | ||
| + | # init db | ||
| + | initdb -D / | ||
| + | # start db | ||
| + | postgres -D ~/ | ||
| + | echo "ALTER USER postgres WITH PASSWORD ' | ||
| + | </ | ||
| + | |||
| + | ==== update php fpm config ==== | ||
| + | |||
| + | ''/ | ||
| + | < | ||
| + | [www] | ||
| + | user = _www | ||
| + | group = _www | ||
| + | listen = 127.0.0.1: | ||
| + | pm = ondemand | ||
| + | pm.max_children = 5 | ||
| + | |||
| + | php_admin_flag[log_errors] = on | ||
| + | php_admin_flag[display_errors] = on | ||
| + | |||
| + | php_admin_value[memory_limit] = 1G | ||
| + | php_admin_value[upload_max_filesize] = 100M | ||
| + | php_admin_value[post_max_size] = 100M | ||
| + | php_admin_value[max_input_vars] = 5000 | ||
| + | php_admin_value[max_file_uploads] = 20 | ||
| + | php_admin_value[date.timezone] = Australia/ | ||
| + | php_admin_value[error_log] = / | ||
| + | </ | ||
| + | |||
| + | ==== update nginx config ==== | ||
| + | |||
| + | ''/ | ||
| + | |||
| + | < | ||
| + | |||
| + | worker_processes | ||
| + | error_log | ||
| + | events { | ||
| + | worker_connections | ||
| + | } | ||
| + | |||
| + | http { | ||
| + | include | ||
| + | default_type | ||
| + | sendfile | ||
| + | keepalive_timeout | ||
| + | server { | ||
| + | listen | ||
| + | server_name | ||
| + | |||
| + | location / { | ||
| + | root / | ||
| + | index index.php index.html index.htm; | ||
| + | } | ||
| + | |||
| + | location ~ [^/ | ||
| + | root / | ||
| + | fastcgi_split_path_info | ||
| + | fastcgi_index | ||
| + | fastcgi_pass | ||
| + | include | ||
| + | fastcgi_param | ||
| + | fastcgi_param | ||
| + | } | ||
| + | } | ||
| + | include servers/*; | ||
| + | } | ||
| + | |||
| </ | </ | ||