之前安装mysql一直都是失败,于是使用了mamp,发现很多扩展安装非常麻烦。于是,又开始动手使用homebrew安装 php7 + mysql5.7 +nginx.
一、设置homebrew
|
|
二、安装nginx
|
|
三、安装mysql
|
|
四、安装php
4.1 安装php5.x
使用brew可以安装php的版本有 5.3、5.4、5.5、5.6
如果已经有安装php,需要unlink后再继续。比如我现在有php54,但要安装hp55,则需要这样去执行升级操作:
|
|
4.2 安装php7.0
mac下重启php-fpm后可能使用了旧的版本,需要执行如下命令使得php和php-fpm调用的是7.0的版本:1export PATH="$(brew --prefix php70)/sbin:$PATH"
4.3 PHP常用扩展安装
|
|
4.4 安装php常见问题
- memcached 依赖问题1PHP Deprecated: PHP Startup: memcached.sess_lock_wait and memcached.sess_lock_max_wait are deprecated. Please update your configuration to use memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries in Unknown on line 0Deprecated: PHP Startup: memcached.sess_lock_wait and memcached.sess_lock_max_wait are deprecated. Please update your configuration to use memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries in Unknown on line 0PHP Deprecated: PHP Startup: memcached.sess_lock_wait and memcached.sess_lock_max_wait are deprecated. Please update your configuration to use memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries in Unknown on line 0Deprecated: PHP Startup: memcached.sess_lock_wait and memcached.sess_lock_max_wait are deprecated. Please update your configuration to use memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries in Unknown on line 0PHP 7.0.2 (cli) (built: Jan 7 2016 10:40:26) ( NTS )Copyright (c) 1997-2015 The PHP GroupZend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies with Xdebug v2.4.0RC3, Copyright (c) 2002-2015, by Derick Rethans
需要注释配置/usr/local/etc/php/7.0/conf.d/ext-memcached.ini
如下内容:12;memcached.sess_lock_wait = 150000;memcached.sess_lock_max_wait = 0
参考: