We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Zephir Parser error Ubuntu

When I am going to build the extension in Ubuntu it's giving me this error. What is the problem? I have followed all the installation steps directed by the installation guide but then why it's happening. $zephir build

zephir_parser extension not loaded, compiling it Parser statistics: 127 terminals, 99 nonterminals, 459 rules 947 states, 0 parser table entries, 0 conflicts make: ** No rule to make target 'clean'. Stop. Preparing for parser compilation... Compiling the parser... /home/sayan/zephir/parser/parser/parser.c: In function 'yy_reduce': /home/sayan/zephir/parser/parser/parser.c:8763:38: warning: passing argument 2 of 'xx_ret_scall' from incompatible pointer type [-Wincompatible-pointer-types] yygotominor.yy132 = xx_ret_scall(0, yymsp[-6].minor.yy0, 1, yymsp[-3].minor.yy0, NULL, status->scanner_state); ^ /home/sayan/zephir/parser/parser/parser.c:1189:14: note: expected 'char ' but argument is of type 'xx_parser_token {aka struct _xx_parser_token }' static zval xx_ret_scall(int dynamic_class, char class_name, int dynamic_method, xx_parser_token M, zval parameters, xx_scanner_state state) ^ /home/sayan/zephir/parser/parser/parser.c:8775:38: warning: passing argument 2 of 'xx_ret_scall' from incompatible pointer type [-Wincompatible-pointer-types] yygotominor.yy132 = xx_ret_scall(0, yymsp[-7].minor.yy0, 1, yymsp[-4].minor.yy0, yymsp[-1].minor.yy132, status->scanner_state); ^ /home/sayan/zephir/parser/parser/parser.c:1189:14: note: expected 'char ' but argument is of type 'xx_parser_token {aka struct _xx_parser_token }' static zval xx_ret_scall(int dynamic_class, char class_name, int dynamic_method, xx_parser_token M, zval parameters, xx_scanner_state state) ^ In file included from /usr/include/string.h:634:0, from /usr/include/php5/main/php_config.h:2543, from /usr/include/php5/main/php.h:34, from /home/sayan/zephir/parser/parser/parser.c:9: /home/sayan/zephir/parser/parser/parser.c: At top level: /home/sayan/zephir/parser/parser/parser.c:9257:7: error: expected identifier or '(' before 'extension' char strndup(const char *s, size_t len) ^ /home/sayan/zephir/parser/parser/scanner.c: In function 'xx_get_token': /home/sayan/zephir/parser/parser/scanner.c:1273:4: warning: implicit declaration of function 'free' [-Wimplicit-function-declaration] free(token->value); ^ /home/sayan/zephir/parser/parser/scanner.c:1273:4: warning: incompatible implicit declaration of built-in function 'free' /home/sayan/zephir/parser/parser/scanner.c:1273:4: note: include '<stdlib.h>' or provide a declaration of 'free' /home/sayan/zephir/parser/parser/parser.c: In function 'xx_parse_program': /home/sayan/zephir/parser/parser/parser.c:9235:17: warning: return makes pointer from integer without a cast [-Wint-conversion]

define SUCCESS 1

             ^

/home/sayan/zephir/parser/parser/parser.c:9350:10: note: in expansion of macro 'SUCCESS' return SUCCESS; ^ make: [parser/parser.lo] Error 1 make: Waiting for unfinished jobs....

libtool: compile: gcc -I. -I/home/sayan/zephir/parser -DPHP_ATOM_INC -I/home/sayan/zephir/parser/include -I/home/sayan/zephir/parser/main -I/home/sayan/zephir/parser -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /home/sayan/zephir/parser/zephir_parser.c -fPIC -DPIC -o .libs/zephir_parser.o libtool: compile: gcc -I. -I/home/sayan/zephir/parser -DPHP_ATOM_INC -I/home/sayan/zephir/parser/include -I/home/sayan/zephir/parser/main -I/home/sayan/zephir/parser -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /home/sayan/zephir/parser/parser/parser.c -fPIC -DPIC -o parser/.libs/parser.o libtool: compile: gcc -I. -I/home/sayan/zephir/parser -DPHP_ATOM_INC -I/home/sayan/zephir/parser/include -I/home/sayan/zephir/parser/main -I/home/sayan/zephir/parser -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /home/sayan/zephir/parser/parser/scanner.c -fPIC -DPIC -o parser/.libs/scanner.o Makefile:183: recipe for target 'parser/parser.lo' failed

PHP Warning: copy(modules/zephir_parser.so): failed to open stream: No such file or directory in /home/sayan/zephir/Library/Compiler.php on line 251 Zephir\Exception: The zephir parser extension could not be found or compiled!

at Library/Compiler.php(256) 0 Library/Compiler.php(269): Zephir\Compiler->compileParser() 1 Library/Compiler.php(328): Zephir\Compiler->preCompile('utils/greeting....') 2 Library/Compiler.php(872): Zephir\Compiler->recursivePreCompile('utils') 3 Library/Compiler.php(1076): Zephir\Compiler->generate(Object(Zephir\Commands\CommandBuild)) 4 Library/Compiler.php(1195): Zephir\Compiler->compile(Object(Zephir\Commands\CommandBuild), false) 5 Library/Compiler.php(1276): Zephir\Compiler->install(Object(Zephir\Commands\CommandBuild), false) 6 Library/Commands/CommandAbstract.php(108): Zephir\Compiler->build(Object(Zephir\Commands\CommandBuild)) 7 Library/Bootstrap.php(200): Zephir\Commands\CommandAbstract->execute(Object(Zephir\Config), Object(Zephir\Logger)) 8 compiler.php(21): Zephir\Bootstrap::boot() 9 {main}



85.5k

php -v ?, i did what you did 2 hours ago without any problems on ubuntu 14.04 and php 5.6.15

edited Dec '15

php -v ?, i did what you did 2 hours ago without any problems on ubuntu 14.04 and php 5.6.15

$ sudo apt-get install git gcc make re2c php5 php5-json php5-dev libpcre3-dev

Reading package lists... Done Building dependency tree
Reading state information... Done gcc is already the newest version. git is already the newest version. libpcre3-dev is already the newest version. make is already the newest version. php5-json is already the newest version. re2c is already the newest version. php5 is already the newest version. php5-dev is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

$php -v

PHP 5.6.11-1ubuntu3.1 (cli) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies

$phpize -v

Configuring for: PHP Api Version: 20131106 Zend Module Api No: 20131226 Zend Extension Api No: 220131226

$ zephir help


/ / _ __ / / ()___ / / / \/ \/ \/ / / / // / // / / / / / / //___/ .__// //// //

Zephir version 0.9.1a-dev

Usage: command [options]

Available commands: help Displays this help build Generate/Compile/Install a Zephir extension compile Compile a Zephir extension api [--theme-path=/path][--output-directory=/path][--theme-options={json}|/path]Generates a HTML API version Shows the Zephir version install Installs the extension (requires root password) clean Cleans the generated object files in compilation init [namespace] Initializes a Zephir extension fullclean Cleans the generated object files in compilation generate Generates C code from the Zephir code stubs Generates extension PHP stubs builddev Generate/Compile/Install a Zephir extension in development mode

Options: -f([a-z0-9-]+) Enables compiler optimizations -fno-([a-z0-9-]+) Disables compiler optimizations -w([a-z0-9-]+) Turns a warning on -W([a-z0-9-]+) Turns a warning off

Now tell me what is the wrong with me. For which parser is not creating.



85.5k

there was another commit yesturday in zephir repo https://github.com/phalcon/zephir/commits/master , can you pull and try again, if not we can exanche skype and fix it



3.3k
Accepted
answer

there was another commit yesturday in zephir repo https://github.com/phalcon/zephir/commits/master , can you pull and try again, if not we can exanche skype and fix it

It's done. Thanks for the suggestion.