一、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. ModSecurity is an open source, cross-platform web application firewall (WAF) module.

    http://www.modsecurity.org/ ModSecurity is an open source, cross-platform web application firewall ( ...

  2. 数组操作方法(包括es5)

    //push(); 定义:可以可向数组的末尾添加一个或更多元素,并返回新的长度. 方法:push(); 语法:数组.push(新元素1,新元素2,....,新元素x) 返回值:把指定的值添加到数组后的 ...

  3. [转载] Oracle在windows下面的自动备份以及删除今天的脚本..

    @echo off echo ================================================ echo Windows环境下Oracle数据库的自动备份脚本 echo ...

  4. Cmder 常用配置

    windows 系统的 cmd 命令窗口不是很好用,可以试试 Cmder 工具包. 1.在运行框中快速启动 Cmder 将 cmder.exe 文件所在目录加载环境变量 PATH 中. 2.把 cms ...

  5. JIRA & GitHub

    JIRA & GitHub https://confluence.atlassian.com/adminjiracloud/connect-jira-cloud-to-github-81418 ...

  6. html 头部 head

    head里面包含标签有: title:html名称,每个html文档都必须有 形式:<title>名字</title>,文档区不显示,浏览器可以识别: 浏览器工具栏显示的页面标 ...

  7. 在finally块中使用try catch,并且catch的时候抛出异常的一个问题

    在finally中使用try/catch,并且catch的时候抛出异常 IDEA会提示警告 Reports throw statements inside of finally blocks. Whi ...

  8. 算法学习——决策单调性优化DP

    update in 2019.1.21 优化了一下文中年代久远的代码 的格式…… 什么是决策单调性? 在满足决策单调性的情况下,通常决策点会形如1111112222224444445555588888 ...

  9. Asp.net与office web apps的整合

    其实网上有关office web app的整合已经有相关的文章了,典型的是如何整合Office Web Apps至自己开发的系统(一) 和如何整合Office Web Apps至自己开发的系统(二), ...

  10. cf1000C Covered Points Count (差分+map)

    考虑如果数字范围没有这么大的话,直接做一个差分数组就可以了 但现在变大了 所以要用一个map来维护 #include<bits/stdc++.h> #define pa pair<i ...