PHP

refGeneral:

PHP Session:

Framework:

Run apache server in mac

Apache default from Mac

sudo apachectl start
sudo apachectl stop

sudo apachectl configtest # check httpd.conf

cd /Library/WebServer/Documents # root folder

PHP settings in httpd.conf

LoadModule php7_module libexec/apache2/libphp7.so
#LoadModule php5_module /usr/local/php5/libphp5.so
...
<FilesMatch .php$>
    SetHandler application/x-httpd-php
</FilesMatch>
...
<IfModule dir_module>
    DirectoryIndex index.php index.html
</IfModule>

Default log location: /var/log/apache2

Disabled Default apache in mac:

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

Composer

brew install composer

PHP5 no macOS Mojave

OSX Binary package download source

based on this

curl -s https://php-osx.liip.ch/install.sh | bash -s force 5.6
export PATH=/usr/local/php5/bin:$PATH

Redis Session Handler

phpredis

Install redis extension

pecl install redis

Change php.ini

session.save_handler = redis
session.save_path = "tcp://host1:6379?weight=1, tcp://host2:6379?weight=2&timeout=2.5, tcp://host3:6379?weight=2&read_timeout=2.5"