# 3.0 框架运行环境

> 需要注意以下环境安装文档仅说明msf框架运行的环境依赖,我们已经将运行环境通过Docker标准化,无须手工一步一步安装,如果对此部分不感兴趣,请直接跳转到[Docker](3.3docker.md)

- Linux,FreeBSD,MacOS(有兼容问题)

- Linux内核版本2.3.32以上(支持epoll)

- PHP-7.0及以上版本(生产环境建议使用PHP-7.1)

- gcc-4.4以上版本

- cmake-2.4+,编译为libswoole.so作为C/C++库时需要使用cmake

- [swoole-1.9.15](https://github.com/swoole/swoole-src/archive/v1.9.15.tar.gz)及以上版本(暂不支持Swoole-2.0)

- [hiredis-0.13.3](https://github.com/redis/hiredis/archive/v0.13.3.tar.gz)

- [yac](https://github.com/laruence/yac/archive/yac-2.0.2.tar.gz)

- [phpredis](http://pecl.php.net/get/redis-3.1.2.tgz)

- composer

## 约定

本手册的所有示例代码都是来自[php-msf-demo](https://github.com/pinguo/php-msf-demo),用户可以克隆后,查看源代码。

## CentOS-6.5

### export

```bash

$>export SRC_DIR=/home/worker/src/

$>export CURL_INSTALL_DIR=${HOME}/libcurl

$>export phpversion=7.1.8

$>export PHP_INSTALL_DIR=${HOME}/php

$>export LIB_MEMCACHED_INSTALL_DIR=/usr/local/

```

### yum

```bash

$>yum -y install \

ca-certificates gcc gcc-c++ perl-CPAN m4 autoconf apr-util yum-utils \

gd libjpeg libtool libpng zlib gettext libevent net-snmp net-snmp-devel net-snmp-libs\

freetype libtool-tldl libxml2 unixODBC inotify-tools \

libxslt libmcrypt freetds ImageMagick jemalloc jemalloc-devel \

gd-devel libjpeg-devel libpng-devel zlib-devel \

freetype-devel libtool-ltdl libtool-ltdl-devel \

libxml2-devel zlib-devel bzip2-devel gettext-devel \

curl-devel gettext-devel libevent-devel \

libxslt-devel expat-devel unixODBC-devel \

openssl-devel libmcrypt-devel freetds-devel \

ImageMagick-devel pcre-devel openldap openldap-devel libc-client-devel

```

### curl

```bash

$>cd ${SRC_DIR} \

&& wget -q -O curl-7.49.0.tar.gz https://curl.haxx.se/download/curl-7.49.0.tar.gz \

&& tar xzf curl-7.49.0.tar.gz \

&& cd curl-7.49.0 \

&& ./configure --prefix=${CURL_INSTALL_DIR} \

&& make 1>/dev/null \

&& make install

```

### libmemcached

```bash

$>cd ${SRC_DIR} \

&& wget -q -O libmemcached-1.0.18.tar.gz https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz \

&& tar xzf libmemcached-1.0.18.tar.gz \

&& cd libmemcached-1.0.18 \

&& ./configure --prefix=$LIB_MEMCACHED_INSTALL_DIR --with-memcached 1>/dev/null \

&& make 1>/dev/null \

&& make install

```

### PHP-7.1.8

```bash

$>cd ${SRC_DIR} \

&& wget -q -O php-${phpversion}.tar.gz http://cn2.php.net/distributions/php-${phpversion}.tar.gz \

&& tar xzf php-${phpversion}.tar.gz \

&& cd php-${phpversion} \

&& ./configure \

--prefix=${PHP_INSTALL_DIR} \

--with-config-file-path=${PHP_INSTALL_DIR}/etc \

--with-config-file-scan-dir=${PHP_INSTALL_DIR}/etc/php.d \

--sysconfdir=${PHP_INSTALL_DIR}/etc \

--with-libdir=lib64 \

--enable-mysqlnd \

--enable-zip \

--enable-exif \

--enable-ftp \

--enable-mbstring \

--enable-mbregex \

--enable-fpm \

--enable-bcmath \

--enable-pcntl \

--enable-soap \

--enable-sockets \

--enable-shmop \

--enable-sysvmsg \

--enable-sysvsem \

--enable-sysvshm \

--enable-gd-native-ttf \

--enable-wddx \

--enable-opcache \

--with-gettext \

--with-xsl \

--with-libexpat-dir \

--with-xmlrpc \

--with-snmp \

--with-ldap \

--enable-mysqlnd \

--with-mysqli=mysqlnd \

--with-pdo-mysql=mysqlnd \

--with-pdo-odbc=unixODBC,/usr \

--with-gd \

--with-jpeg-dir \

--with-png-dir \

--with-zlib-dir \

--with-freetype-dir \

--with-zlib \

--with-bz2 \

--with-openssl \

--with-curl=${CURL_INSTALL_DIR} \

--with-mcrypt \

--with-mhash \

&& make 1>/dev/null \

&& make install

```

### php-yaml

```bash

$>cd $SRC_DIR \

&& wget -O yaml-0.1.5.tar.gz http://pyyaml.org/download/libyaml/yaml-0.1.5.tar.gz \

&& tar xzf yaml-0.1.5.tar.gz \

&& cd yaml-0.1.5 \

&& ./configure --prefix=/usr/local \

&& make >/dev/null \

&& make install \

&& cd $SRC_DIR \

&& wget --http-user=pinguo-ops --http-passwd=iR0n6O3lNk5YtO3vH7Cd http://ops-packages.camera360.com/soft/yaml-2.0.0.tgz \

&& tar xzf yaml-2.0.0.tgz \

&& cd yaml-2.0.0 \

&& $PHP_INSTALL_DIR/bin/phpize \

&& ./configure --with-yaml=/usr/local --with-php-config=$PHP_INSTALL_DIR/bin/php-config \

&& make >/dev/null \

&& make install

```

### php-mongodb

```php

$>cd ${SRC_DIR} \

&& wget http://pecl.php.net/get/mongodb-1.2.8.tgz \

&& tar zxvf mongodb-1.2.8.tgz \

&& cd mongodb-1.2.8 \

&& ${PHP_INSTALL_DIR}/bin/phpize \

&& ./configure --with-php-config=$PHP_INSTALL_DIR/bin/php-config 1>/dev/null \

&& make clean \

&& make -j \

&& make install

```

### php-redis

```bash

$>cd ${SRC_DIR} \

&& wget http://pecl.php.net/get/redis-3.1.2.tgz \

&& tar zxvf redis-3.1.2.tgz \

&& cd redis-3.1.2 \

&& ${PHP_INSTALL_DIR}/bin/phpize \

&& ./configure --with-php-config=$PHP_INSTALL_DIR/bin/php-config 1>/dev/null \

&& make clean \

&& make 1>/dev/null \

&& make install

```

### php-imagick

```bash

$>cd ${SRC_DIR} \

&& wget http://pecl.php.net/get/imagick-3.4.3.tgz \

&& tar zxvf imagick-3.4.3.tgz \

&& cd imagick-3.4.3 \

&& ${PHP_INSTALL_DIR}/bin/phpize \

&& ./configure --with-php-config=$PHP_INSTALL_DIR/bin/php-config 1>/dev/null \

&& make clean \

&& make 1>/dev/null \

&& make install

```

### php-xdebug

```bash

$>cd ${SRC_DIR} \

&& wget http://pecl.php.net/get/xdebug-2.5.3.tgz \

&& tar zxvf xdebug-2.5.3.tgz \

&& cd xdebug-2.5.3 \

&& ${PHP_INSTALL_DIR}/bin/phpize \

&& ./configure --with-php-config=$PHP_INSTALL_DIR/bin/php-config 1>/dev/null \

&& make clean \

&& make 1>/dev/null \

&& make install

```

### php-igbinary

```bash

$cd ${SRC_DIR} \

&& wget http://pecl.php.net/get/igbinary-2.0.1.tgz \

&& tar zxvf igbinary-2.0.1.tgz \

&& cd igbinary-2.0.1 \

&& ${PHP_INSTALL_DIR}/bin/phpize \

&& ./configure --with-php-config=$PHP_INSTALL_DIR/bin/php-config 1>/dev/null \

&& make clean \

&& make 1>/dev/null \

&& make install

```

### php-memcached

```bash

$>cd ${SRC_DIR} \

&& wget http://pecl.php.net/get/memcached-3.0.3.tgz \

&& tar xzf memcached-3.0.3.tgz \

&& cd memcached-3.0.3 \

&& ${PHP_INSTALL_DIR}/bin/phpize \

&& ./configure --enable-memcached --with-php-config=$PHP_INSTALL_DIR/bin/php-config \

--with-libmemcached-dir=$LIB_MEMCACHED_INSTALL_DIR --disable-memcached-sasl 1>/dev/null \

&& make 1>/dev/null \

&& make install

```

### php-yac

```bash

$>cd ${SRC_DIR} \

&& wget https://github.com/laruence/yac/archive/yac-2.0.2.tar.gz \

&& tar zxvf yac-2.0.2.tar.gz \

&& cd yac-yac-2.0.2 \

&& ${PHP_INSTALL_DIR}/bin/phpize \

&& ./configure --with-php-config=${PHP_INSTALL_DIR}/bin/php-config \

&& make 1>/dev/null \

&& make install

```

### phpunit

```bash

$>cd ${SRC_DIR} \

&& wget -O phpunit.phar https://phar.phpunit.de/phpunit.phar \

&& mv phpunit.phar ${PHP_INSTALL_DIR}/bin/phpunit \

&& chmod +x ${PHP_INSTALL_DIR}/bin/phpunit

```

### composer

```bash

$>cd ${SRC_DIR} \

&& curl -sS https://getcomposer.org/installer | $PHP_INSTALL_DIR/bin/php \

&& chmod +x composer.phar \

&& mv composer.phar ${PHP_INSTALL_DIR}/bin/composer

```

### hiredis

```bash

$>cd ${SRC_DIR} \

&& wget -O hiredis-0.13.3.tar.gz https://github.com/redis/hiredis/archive/v0.13.3.tar.gz \

&& tar zxvf hiredis-0.13.3.tar.gz \

&& cd hiredis-0.13.3 \

&& make -j \

&& make install \

&& echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf \

&& ldconfig

```

### php-swoole

```bash

$>cd ${SRC_DIR} \

&& wget -q -O swoole-1.9.18.tar.gz https://github.com/swoole/swoole-src/archive/v1.9.18.tar.gz \

&& tar zxvf swoole-1.9.18.tar.gz \

&& cd swoole-src-1.9.18/ \

&& ${PHP_INSTALL_DIR}/bin/phpize \

&& ./configure --with-php-config=$PHP_INSTALL_DIR/bin/php-config --enable-async-redis --enable-openssl \

&& make clean 1>/dev/null \

&& make 1>/dev/null \

&& make install

```

### php-inotify

```bash

$>cd ${SRC_DIR} \

&& wget http://pecl.php.net/get/inotify-2.0.0.tgz \

&& tar zxvf inotify-2.0.0.tgz \

&& cd inotify-2.0.0 \

&& ${PHP_INSTALL_DIR}/bin/phpize \

&& ./configure --with-php-config=$PHP_INSTALL_DIR/bin/php-config 1>/dev/null \

&& make clean \

&& make 1>/dev/null \

&& make install

```

### jq

```bash

$>cd ${SRC_DIR} \

&& wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 \

&& mkdir -p /home/worker/bin \

&& mv jq-linux64 ${HOME}/bin/jq \

&& chmod +x ${HOME}/bin/jq

```

### git

```bash

$>cd ${SRC_DIR} \

&& mkdir -p ${SRC_DIR} \

&& yum -y remove git \

&& wget https://www.kernel.org/pub/software/scm/git/git-2.13.0.tar.gz \

&& tar zxvf git-2.13.0.tar.gz \

&& cd git-2.13.0 \

&& make configure \

&& ./configure --prefix=/usr/local/ --with-curl=${CURL_INSTALL_DIR} \

&& make -j \

&& make install

```

php msf dev product,3 框架运行环境相关推荐

  1. 如何搭建html运行环境,搭建基于express框架运行环境的方法步骤

    一.Express简介 Express提供了一个轻量级模块,把Node.js的http模块功能封装在一个简单易用的接口中.Express也扩展了http模块的功能,使你轻松处理服务器的路由.响应.co ...

  2. php larval框架运行环境,Laravel框架的运行环境配置(一)

    Laravel框架 学习参考: Laravel的特点; 单一入口:所有请求必须从单入口开始,主要是关于管理[统一的参数过滤] MVC的思想 ORM操作数据库 一个模型对应数据库里面的一张表,对象的属性 ...

  3. php larval框架运行环境,4种Windows系统下Laravel框架的开发环境安装及部署方法详解...

    1.准备工作 1.1PHP集成环境 这里我们使用的是XAMPP,XAMPP是一个功能强大的建站集成软件包,采用一键安装的方式,包含PHP7.0.Mysql.Tomcat等.最新版下载地址:PHP 5. ...

  4. 尚硅谷大数据技术Spark教程-笔记01【Spark(概述、快速上手、运行环境、运行架构)】

    视频地址:尚硅谷大数据Spark教程从入门到精通_哔哩哔哩_bilibili 尚硅谷大数据技术Spark教程-笔记01[Spark(概述.快速上手.运行环境.运行架构)] 尚硅谷大数据技术Spark教 ...

  5. 【C++基础】【集成编译环境01】Clion的C++编译环境和Boost Test Framworks框架运行实践

    本文项目源码链接: CLionboostunittestframeworks项目源码-C++文档类资源-CSDN文库 前言和行文思路: VScode.Clion.Pycharm都是集成环境的编辑器,他 ...

  6. Mybatis入门:1(Mybatis框架的环境搭建)

    Mybatis框架的环境搭建 一.创建maven工程并导入坐标 导入坐标: <dependencies><dependency><groupId>org.mybat ...

  7. 配置React项目的运行环境

    两种配置react项目运行环境的方法 第一种方法,一步步配置项目的运行环境: 1)下载node,在官方网站可以下载,安装步骤不难,差不多一步步意 点next就行: 2)运行cmd 输入node -v ...

  8. 构建深度学习框架运行平台

    构建深度学习框架运行平台 将为TensorFlow.PyTorch和TorchScript之外的元素构建一个简单的深度学习框架运行平台模型.将展示如何从Python和C++运行推理. 打包和推断接口还 ...

  9. OSGI企业应用开发(二)Eclipse中搭建Felix运行环境

    上篇文章介绍了什么是OSGI以及使用OSGI构建应用的优点,接着介绍了两款常用的OSGI实现,分别为Apache Felix和Equinox,接下来开始介绍如何在Eclipse中使用Apache Fe ...

最新文章

  1. 在eclipse中使用Lombok
  2. 如何挂载阿里云Linux服务器的“数据盘”(新购买)
  3. 日常生活小技巧 -- SecureCRT上传和下载文件
  4. python 视频字幕替换_利用python调整srt字幕时间轴
  5. Hadoop日志分析工具——White Elephant
  6. JavaScript基础函数体中的唯一var模式(002)
  7. 如何监控impala的数据_impala数据库的函数
  8. python实现dos攻击_python 实现DoS攻击
  9. 网关 配置内网DNS 服务器
  10. OpenCore引导配置说明第十一版说明-基于OpenCore-0.6.4正式版
  11. 投稿信Cover Letter如何写,能留下完美第一印象?(附模板)
  12. 通信原理中的erf/erfc函数
  13. 凯恩帝对刀和刀补_KND数控车床试切对刀和调刀补
  14. 动画 | 什么是红黑树?(与2-3-4树等价)
  15. Java 后台做图片压缩的两种方法
  16. 面试总结+感悟+分享
  17. AI产品经理入门手册(上)
  18. 精度、召回率、准确率、F1、ROC、AUC的理解
  19. 域名、主机名与URL
  20. 让终端泄密行为明明白白的局域网监控应用

热门文章

  1. dojo解决这个问题Tried to register widget with id==quot;myidquot; but that id is already registered
  2. 领域驱动设计(DDD)的精髓
  3. Python注释缩进不得当导致IndentationError: unexpected indent
  4. 用简单的方法构建一个高可用服务端
  5. 今日头条的,顶部导航,实现分析
  6. Spark1.4启动spark-shell时initializing失败
  7. 好用的工具---screen命令
  8. discuz问题综合
  9. more effective C++
  10. 2018年12月2526日