PHP7 Study Notes (vii) How to compile an extended record using Zephir

Source: Internet
Author: User
Tags zend

I. Errors encountered by Zephir compilation

Installation

git clone https://Github.com/phalcon/zephir
$ cd zephir$. /Install-json$. /Install -C

Compile

[Email protected]:~$ zephir build──────────────────────────────────────────────────────────── the  Zephir Parser extension is not loaded.  Note:zephir no longer distributed with internal parser.     Install Latest Stable Zephir Parser refer to:  https://Github.com/phalcon/php-zephir-parser ────────────────────────────────────────────────────────────
Second, Php-zephir-parser installation
git clone git://github.com/phalcon/php-zephir-parser.git

Php7.0-dev Installation Error

sudo Install PHP7. 0 GCC  Make re2c autoconfreading Package lists ... Donebuilding dependency Tree       Locate package php7. 0-deve:couldn'php7. 0-dev'

How to get the solution

1, php7 the problem of the repository, add PHP7 PPA

sudo add-apt-repository ppa:ondrej/php

2. Update the Library

sudo apt-get update

3. Now do a search to confirm that PHP7 is there.

sudo apt search php7

Reinstall, no error is

[Email protected]:~$sudoApt-getInstallPhp7.0-devGCC  Makere2c autoconfreading Package lists ... Donebuilding Dependency Tree Reading state information ... DoneGCCIs already the newest version.GCCset to manually installed. MakeIs already the newest version.re2c is already the newest version. The following extra packages'll be Installed:automake autotools-dev debhelper dh-apparmor dh-php gettext intltool-Debian libasprintf-dev Libgettextpo-dev libgettextpo0 liblist-moreutils-PerlLibltdl-dev libmail-sendmail-PerlLIBSSL1.1libsys-hostname-Long-Perllibtool libunistring0 M4 php-common php-pear php-xml PHP7.0-CLI PHP7.0-common PHP7.0-json PHP7.0-opcache PHP7.0-readline PHP7.1-Common PHP7.1-xml pkg-php-tools po-debconf Shtool xml2

Start compiling

[Email protected]:~/ffmpeg_videos/php-zephir-parser$sudo./InstallGenerating parser ... Parser Statistics: theTerminals, AboutNonterminals,470rules982States,0Parser table entries,0conflictsconfiguring for:P hp Api Version:20151012Zend Module Api No:20151012Zend Extension Api No:320151012Libtool: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/20151012/main-i/usr/include/php/20151012/tsrm-i/usr/include/php/ 20151012/zend-i/usr/include/php/20151012/ext
-i/usr/include/php/20151012/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

Compile complete

Find the. So file path

sudo Find /-name zephir_parser.so/usr/lib/php/20151012/zephir_parser.so

Configuring the php.ini File

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

Add a little bit of content:

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

Installation Complete

third, recompile, the same error occurred:
[Email protected]:~/ffmpeg_videos/zephir-framework/lib$ Zephir build──────────────────────────────────────────────────────────── the  Zephir Parser extension is not loaded.  Note:zephir no longer distributed with internal parser.     Install Latest Stable Zephir Parser refer to:  https://github.com/phalcon/ Php-zephir-parser────────────────────────────────────────────────────────────

Good tangled ah, how to solve:

sudo LN -s/opt/php-7.0. 9/bin/php/usr/bin/php

Go on, Ok:

[Email protected]:~/ffmpeg_videos/zephir-framework/zephirlib$ Zephir buildcompiling ... Installing ... Extension installed! Add extension=zephirlib.so to your php.ini

PHP7 Study Notes (vii) How to compile an extended record using Zephir

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.