美文网首页
Mac折腾LNMP

Mac折腾LNMP

作者: boxcore | 来源:发表于2016-04-06 10:30 被阅读764次

之前安装mysql一直都是失败,于是使用了mamp,发现很多扩展安装非常麻烦。于是,又开始动手使用homebrew安装 php7 + mysql5.7 +nginx.

一、设置homebrew

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew update
 brew tap homebrew/dupes 
 brew tap homebrew/versions 
 brew tap homebrew/homebrew-php 

二、安装nginx

# 重启nginx : sudo nginx -s reload|stop
sudo nginx -s stop && sudo nginx

三、安装mysql

brew edit mysql
wget xxxx-5.7.11.tar.gz
mv mysql-5.7.11.el_capitan.bottle.tar.gz /Library/Caches/Homebrew/
brew install mysql

四、安装php

4.1 安装php5.x

使用brew可以安装php的版本有 5.3、5.4、5.5、5.6

如果已经有安装php,需要unlink后再继续。比如我现在有php54,但要安装hp55,则需要这样去执行升级操作:

brew unlink php54
brew install php55

4.2 安装php7.0

mac下重启php-fpm后可能使用了旧的版本,需要执行如下命令使得php和php-fpm调用的是7.0的版本:

export PATH="$(brew --prefix php70)/sbin:$PATH"

4.3 PHP常用扩展安装

# swoole: https://github.com/swoole/swoole-src/releases/
# redis:  下载:https://github.com/phpredis/phpredis/tree/php7

# 以上安装方式都是:
./configure
make && make install

# memcached
brew install memcached
brew install php70-memcached

4.4 安装php常见问题

  1. memcached 依赖问题
PHP 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如下内容:

;memcached.sess_lock_wait = 150000
;memcached.sess_lock_max_wait = 0

参考


博客已经迁移:阅读原文

相关文章

  • Mac折腾LNMP

    之前安装mysql一直都是失败,于是使用了mamp,发现很多扩展安装非常麻烦。于是,又开始动手使用homebrew...

  • 折腾LNMP:mongoDB的php扩展

    前事提要:折腾LNMP: Nginx + thinkphp5折腾LNMP:mongoDB折腾LNMP:robo 3...

  • 折腾LNMP:mongoDB

    mongoDB是导致我重装了3次系统的原因。 第1次,懵懵懂懂,死在nginx+php-fpm的配置上,配了没反应...

  • LNMP环境的搭建

    lnmp环境的搭建 lnmp是黄金搭档,是linux、nginx、mysql、php的合称。昨天刚好折腾了下,装成...

  • Vargant Ubuntu 15.04安装LNMP

    Vargant Ubuntu 15.04安装LNMP 环境Mac Os 10.11.11.Vagrant 1.7....

  • mac lnmp命令

    mysql php

  • Mac 安装 LNMP 环境

    Mac 安装 Lnmp环境 1、安装Homebrew Homebrew是一款Mac系统下的软件包管理工具,brew...

  • 源码安装LNMP centos+nginx+php7.4+mys

    lnmp : linux(centos7.4)+nginx+php7.4 +mysql 写在前面的 最近又来折腾自...

  • 2019-08-10

    搭建 teamtalk 服务器 (一)配置lnmp环境 环境:硬件:Mac 电脑 系统:虚拟机安装的Li...

  • Mac安装LNMP环境

    这两天在Mac上安装LNMP开发环境,现在整理一下安装的大概步骤及需要注意的点 1. 安装Homebrew Hom...

网友评论

      本文标题:Mac折腾LNMP

      本文链接:https://www.haomeiwen.com/subject/mfpslttx.html