2018-03-28 centos6环境安装 php-zephir-parser扩展

1、安装依赖的包

yum install php-devel gcc make  autoconf 

2、安装re2c-0.16

这里需要注意 re2c的版本> = 0.13.6,centos6自带的为0.13.5,需要手动编译安装

wget https://sourceforge.net/projects/re2c/files/0.16/re2c-0.16.tar.gz
tar zxf re2c-0.16.tar.gz && cd re2c-0.16
./configure
make && make install
ln -s /usr/local/bin/re2c /usr/bin/re2c
re2c --version #查看是否是0.16版本

注意这里安装的时候可能报错,有些主机安装不了,可以在别的机器上安装好后将/usr/local/bin/re2c文件拷贝到安装不了的主机的/usr/bin目录下

3、安装php-zephir-parser

git clone git://github.com/phalcon/php-zephir-parser.git
cd php-zephir-parser
./install

4、将扩展名添加到您的php.ini中

[Zephir Parser] 
extension = zephir_parser.so
service php-fpm restart

5、编写phpinfo进行测试

编辑nginx的配置文件

vim server.conf 

server {
    listen 80;
    server_name haha.xxx.com;
    root /data/wwwroot/test-com;
     location ~ .*\.(php|php5)?$ {
                fastcgi_pass  fastcgi_server;
                fastcgi_index index.php;
                include /nfs/local/openresty/nginx/conf/common/setting/fastcgi.conf;
        }

}
在网站的根目录下编辑index.php
vim index.php

6、访问网站

出现phpinfo的信息,信息中包含如下说明安装成功

2018-03-28 centos6环境安装 php-zephir-parser扩展_第1张图片
image.png

参考: https://blog.csdn.net/a454213722/article/details/51866100
https://github.com/phalcon/php-zephir-parser/tree/development

你可能感兴趣的:(2018-03-28 centos6环境安装 php-zephir-parser扩展)