1.切换到 /usr/local/src 目录下,使用下载phalcon扩展
```
cd /usr/local/src
git clone --depth=1 git://github.com/phalcon/cphalcon.git
```
2.进入下载好的cphalcon下,编译安装phalcon框
```
cd /usr/local/src/cphalcon/build/php7/64bits/
/usr/local/php/bin/phpize
```
![image](https://upload-images.jianshu.io/upload_images/6954572-5fe7ca1cbba71704.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
3.编译
```
./configure --with-php-config=/usr/local/php/bin/php-config
```
![image](https://upload-images.jianshu.io/upload_images/6954572-2acb159aa678c495.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
5.最后执行安装命令
```
make && make install
```
安装完成后会在/usr/local/php/lib/php/extensions/no-debug-non-zts-20151012/生成phalcon.so文件
![image](https://upload-images.jianshu.io/upload_images/6954572-89498faabe2b3a3f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
6.配置php.ini文件,在新的一行添加:extension=phalcon.so即可
![image](https://upload-images.jianshu.io/upload_images/6954572-b0efa315125a1c31.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
7.重启php-fpm
```
service php-fpm restart
```
查看phpinfo()出现如下:
![image](https://upload-images.jianshu.io/upload_images/6954572-12a68c2742da0f2f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)