xcrbmw
Last Updated: February 25, 2016
·
589
· clonn

Nginx, PHP54 and MySQL install in Mac

php54, mysql, nginx install in Mac by homebrew

prepare

  • installed homebrew

install script

sudo brew update
https://gist.github.com/mystix/3041577

Setting

reset mysql root account

/usr/local/opt/mysql/bin/mysqladmin -u root password 'new-password'
mysql -u root -p

html / php setting

/usr/local/var/www

nginx

/usr/local/etc/nginx/nginx.conf

edit nginx config, remove comments


location ~ .php$ { root html; fastcgipass 127.0.0.1:9000; fastcgiindex index.php; include fastcgiparams; fastcgiparam SCRIPTFILENAME /usr/local/var/www/$fastcgiscript_name; } </code> </pre> then reload nginx, sudo nginx -s reload or stop nginx and start it. sudo nginx -s stop sudo nginx mysql, fpm, fastcgi, apc already install and run with it try add a php file in html path. save as info.php <?php phpinfo(); ?> show result in browser, http://localhost/info.php