一、zephir 编译遇到的错误

安装

git clone https://github.com/phalcon/zephir
$ cd zephir
$ ./install-json
$ ./install -c

编译

www@ubuntu4:~$ zephir build

────────────────────────────────────────────────────────────
The Zephir Parser extension is not loaded.
Note: Zephir no longer distributed with internal parser. To install latest stable Zephir Parser please refer to:
https://github.com/phalcon/php-zephir-parser
────────────────────────────────────────────────────────────

二、php-zephir-parser 安装

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

php7.0-dev 安装报错

www@ubuntu4:~$ sudo apt-get install php7.-dev gcc make re2c autoconf
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.-dev
E: Couldn't find any package by regex 'php7.-dev'

如何让解决

1、php7的存储库的问题,添加php7 ppa

sudo add-apt-repository ppa:ondrej/php

2、更新库

sudo apt-get update

3、现在做一个搜索来确认php7是有的

sudo apt search php7

重新安装,则不会报错

www@ubuntu4:~$ sudo apt-get install php7.-dev gcc make re2c autoconf
Reading package lists... Done
Building dependency tree
Reading state information... Done
gcc is already the newest version.
gcc set to manually installed.
make is already the newest version.
re2c is already the newest version.
The following extra packages will be installed:
automake autotools-dev debhelper dh-apparmor dh-php gettext intltool-debian
libasprintf-dev libgettextpo-dev libgettextpo0 liblist-moreutils-perl
libltdl-dev libmail-sendmail-perl libssl1. libsys-hostname-long-perl
libtool libunistring0 m4 php-common php-pear php-xml php7.-cli
php7.-common php7.-json php7.-opcache php7.-readline php7.-common
php7.-xml pkg-php-tools po-debconf shtool xml2

开始编译

www@ubuntu4:~/ffmpeg_videos/php-zephir-parser$ sudo ./install
Generating parser...
Parser statistics: terminals, nonterminals, rules
states, parser table entries, conflicts
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
libtool: compile: gcc -I. -I/home/www/ffmpeg_videos/php-zephir-parser -DPHP_ATOM_INC -I/home/www/ffmpeg_videos/php-zephir-parser/include
-I/home/www/ffmpeg_videos/php-zephir-parser/main -I/home/www/ffmpeg_videos/php-zephir-parser -I/usr/include/php/20151012 -I/usr/include/php//main -I/usr/include/php//TSRM -I/usr/include/php//Zend -I/usr/include/php//ext
-I/usr/include/php//ext/date/lib -DHAVE_CONFIG_H -march=native -mtune=native -O2 -fomit-frame-pointer -fvisibility=hidden -flto
-c /home/www/ffmpeg_videos/php-zephir-parser/zephir_parser.c -fPIC -DPIC -o .libs/zephir_parser.o

或者指定编译配置文件

$./install --phpize /usr/local/php-7.1./bin/phpize --php-config /usr/local/php-7.1./bin/php-config

....

  

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

Installing shared extensions: /usr/local/php-7.1.11/lib/php/extensions/no-debug-non-zts-20160303/
Cleaning..

Thanks for compiling Zephir Parser!
Build succeed: Please restart your web server to complete the installation

编译完成

查找.so 文件路径

www@ubuntu4:~ sudo find / -name zephir_parser.so
/usr/lib/php//zephir_parser.so

配置php.ini 文件

sudo vim /opt/php-7.1./etc/php.ini

添加一下内容:

[Zephir Parser]
extension=/usr/lib/php//zephir_parser.so

安装完毕

三、重新编译,出现同样的错误:

www@ubuntu4:~/ffmpeg_videos/zephir-framework/lib$ zephir build

────────────────────────────────────────────────────────────
The Zephir Parser extension is not loaded.
Note: Zephir no longer distributed with internal parser. To install latest stable Zephir Parser please refer to:
https://github.com/phalcon/php-zephir-parser
────────────────────────────────────────────────────────────

好纠结啊,如何解决:

直接系统自动默认安装的

rm /usr/bin/php

做个软连接

sudo ln -s /opt/php-7.0./bin/php /usr/bin/php

继续,Ok 了:

www@ubuntu4:~/ffmpeg_videos/zephir-framework/zephirlib$ zephir build
Compiling...
Installing...
Extension installed!
Add extension=zephirlib.so to your php.ini

编译PHP7 如何使用 Cli 命令而不是软连接

  • root用户,sudo vim /etc/profile

  • 添加PHP7编译的路径:export PATH=$PATH:/usr/local/php-7.1.8/bin,执行source profile使生效

PHP7 学习笔记(七)如何使用zephir编译一个扩展记录的更多相关文章

  1. PHP7 学习笔记(十六)Yaconf 一个高性能的配置管理扩展

    鸟哥博客原文:Yaconf – 一个高性能的配置管理扩展 什么是yaconf ? 它使用单独的一个配置目录(在yaconf.directory指定), 不和代码在一起.它在PHP启动的时候, 处理所有 ...

  2. Typescript 学习笔记七:泛型

    中文网:https://www.tslang.cn/ 官网:http://www.typescriptlang.org/ 目录: Typescript 学习笔记一:介绍.安装.编译 Typescrip ...

  3. (转)Qt Model/View 学习笔记 (七)——Delegate类

    Qt Model/View 学习笔记 (七) Delegate  类 概念 与MVC模式不同,model/view结构没有用于与用户交互的完全独立的组件.一般来讲, view负责把数据展示 给用户,也 ...

  4. Learning ROS for Robotics Programming Second Edition学习笔记(七) indigo PCL xtion pro live

    中文译著已经出版,详情请参考:http://blog.csdn.net/ZhangRelay/article/category/6506865 Learning ROS forRobotics Pro ...

  5. python3.4学习笔记(七) 学习网站博客推荐

    python3.4学习笔记(七) 学习网站博客推荐 深入 Python 3http://sebug.net/paper/books/dive-into-python3/<深入 Python 3& ...

  6. Go语言学习笔记七: 函数

    Go语言学习笔记七: 函数 Go语言有函数还有方法,神奇不.这有点像python了. 函数定义 func function_name( [parameter list] ) [return_types ...

  7. iOS 学习笔记七 【博爱手把手教你使用2016年gitHub Mac客户端】

    iOS 学习笔记七 [博爱手把手教你使用gitHub客户端] 第一步:首先下载git客户端 链接:https://desktop.github.com 第二步:fork 大神的代码[这里以我的代码为例 ...

  8. 【opencv学习笔记七】访问图像中的像素与图像亮度对比度调整

    今天我们来看一下如何访问图像的像素,以及如何改变图像的亮度与对比度. 在之前我们先来看一下图像矩阵数据的排列方式.我们以一个简单的矩阵来说明: 对单通道图像排列如下: 对于双通道图像排列如下: 那么对 ...

  9. Linux学习笔记(七) 查询系统

    1.查看命令 (1)man 可以使用 man 命令名称 命令查看某个命令的详细用法,其显示的内容如下: NAME:命令名称 SYNOPSIS:语法 DESCRIPTION:说明 OPTIONS:选项 ...

随机推荐

  1. Qt__状态栏(statusBar)

    转自豆子空间 状态栏位于主窗口的最下方,提供一个显示工具提示等信息的地方.一般地,当窗口不是最大化的时候,状态栏的右下角会有一个可以调节大小的控制点:当窗口最大化的时候,这个控制点会自动消失.Qt提供 ...

  2. datatime

    /把一个日期字符串如“2007-2-28 10:18:30”转换为Date对象 var   strArray=str.split("   "); var   strDate=str ...

  3. Lodop打印设计界面生成代码带”...(省略)”

    Lodop的设计界面中,菜单里的生成代码,如果打印项内容过多,后面会显示”...(省略)”,省略的是打印项的内容值,无论是纯文本还是超文本,都可以用选中打印项-右键-设置属性里找到该打印项的全部值,可 ...

  4. Omni(USDT)钱包安装(ubuntu)

    一.下载Omni Layer钱包 wget https://bintray.com/artifact/download/omni/OmniBinaries/omnicore-0.3.0-x86_64- ...

  5. 普通javabean 获得项目的绝对路径

    方式一:String path = RequestContext.class.getResource("/").getFile();

  6. BZOJ2553[BeiJing2011]禁忌——AC自动机+概率DP+矩阵乘法

    题目描述 Magic Land上的人们总是提起那个传说:他们的祖先John在那个东方岛屿帮助Koishi与其姐姐Satori最终战平.而后,Koishi恢复了读心的能力…… 如今,在John已经成为传 ...

  7. BZOJ3298[USACO 2011Open]cow checkers——威佐夫博弈

    题目描述 一天,Besssie准备和FJ挑战奶牛跳棋游戏.这个游戏上在一个M*N的棋盘上, 这个棋盘上在(x,y)(0<=x棋盘的左下角是(0,0)坐标,棋盘的右上角是坐标(M-1,N-1). ...

  8. JSP 和 Servlet 的工作原理和生命周期

    JSP的英文名叫Java Server Pages,翻译为中文是Java服务器页面的意思,其底层就是一个简化的Servlet设计,是由sum公司主导参与建立的一种动态网页技术标准.Servlet 就是 ...

  9. pycharm同级目录导入问题

    在PyCharm2017中同目录下import其他模块,会出现No model named ...的报错,但实际可以运行 这是因为PyCharm不会将当前文件目录自动加入source_path. 在当 ...

  10. MT【44】抛物线不常见性质3

    注:S为抛物线的焦点