Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
php:macos-installation [2021-10-28] dcaiphp:macos-installation [2021-10-31] (current) dcai
Line 1: Line 1:
-== mac installation ==+===== PHP 7.4 macOS installation =====
  
 +
 +==== install packages ====
 <code> <code>
-# fish shell +brew install php@7.4 nginx postgresql@12 
-brew install php@7.4 nginx +pecl install zip libsodium
-pecl install zip libsodium+
 # remove duplicated extension added in /usr/local/etc/php/7.4/php.ini # remove duplicated extension added in /usr/local/etc/php/7.4/php.ini
 +brew link php@7.4
 +brew link postgresql@12
 </code> </code>
  
-== update php fpm config ==+ 
 +==== setup postgres ==== 
 +<code> 
 +# init db 
 +initdb -D /Users/dcai/.local/var/postgres12 
 +# start db 
 +postgres -D ~/.local/var/postgres12/ 
 +echo "ALTER USER postgres WITH PASSWORD 'postgres';" | psql -U postgres 
 +</code> 
 + 
 +==== update php fpm config ====
  
 ''/opt/homebrew/etc/php/7.4/php-fpm.d/www.conf'' ''/opt/homebrew/etc/php/7.4/php-fpm.d/www.conf''
 <code> <code>
-; 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] [www]
 user = _www user = _www
Line 21: Line 31:
 pm = ondemand pm = ondemand
 pm.max_children = 5 pm.max_children = 5
-php_admin_value[memory_limit] = 1G 
  
 +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/Sydney
 +php_admin_value[error_log] = /tmp/phperror.log
 </code> </code>
  
-== update nginx config ==+==== update nginx config ====
  
 ''/opt/homebrew/etc/nginx/nginx.conf'' ''/opt/homebrew/etc/nginx/nginx.conf''
php/macos-installation.1635411175.txt.gz · Last modified: by dcai