# 搭建前
- 创建工作目录
```
cd /home && mkdir src
```
- 设置环境变量
```
export HOME=/home
export SRC_DIR=/home/src/
export CURL_INSTALL_DIR=${HOME}/libcurl
export phpversion=7.2.17
export PHP_INSTALL_DIR=${HOME}/php
export LIB_MEMCACHED_INSTALL_DIR=/usr/local/
```
- 更新系统
```
yum update -y
```
- 安装依赖
```
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 epel-release\
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 automake make wget zip unzip
执行完毕后再执行一次,确保都安装完成。
```
![](https://box.kancloud.cn/f6ed9f7aab29de40570bdf7512b1a7e6_986x766.gif)
# 开始搭建
- 安装curl
```
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
```
![](https://box.kancloud.cn/828e4908c9e21df9d559d61493b64c00_986x766.gif)