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 error

Hi,everyone. I have installed zephir and tried to the first example(utils.zep),but it can not work.

The message is "PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/utils.so"


[[email protected]]# php -v

PHP 5.6.30 (cli) (built: Jan 19 2017 22:50:24)

Copyright (c) 1997-2016 The PHP Group

Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies


[[email protected]]# php -m

[PHP Modules]

bcmath bz2 calendar Core ctype curl date dom ereg exif fileinfo filter ftp gd gettext gmp hash iconv json libxml mbstring mcrypt mhash mysql mysqli openssl pcntl pcre PDO pdomysql pdosqlite phalcon Phar readline Reflection session shmop SimpleXML sockets SPL sqlite3 standard tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zip zlib

My system is centos 6.8.

Does anyone have the same problem?



29.3k
Accepted
answer

Where does utils.zep come from? The zephir repo does not have any examples...

Also, make sure you've read the documentation properly before posting errors :P

https://docs.zephir-lang.com/en/latest/install.html



1.1k
edited 5d ago

I got the utils.zep code from documentation. https://docs.zephir-lang.com/en/latest/tutorial.html

sorry, I had read the documentation, but I thought php5.6 is also ok. Because I do not want to upgrade my php version yet...

Anyway, thanks a lot!

edited 5d ago

It should work with PHP5.6 too, just make sure you compile with zephir build --backend=ZendEngine2 (--backend=ZendEngine3 corresponds to PHP7)



1.1k
edited 5d ago

It should work with PHP5.6 too, just make sure you compile with zephir build --backend=ZendEngine2 (--backend=ZendEngine3 corresponds to PHP7)

I will try.

Thank you very much!


it does not work. And I noted that the function BaseBackend::getActiveBackend() can offer ZendEngine2 to Backend param if the php version is less than 7.2......



1.1k

It is ok when I replace zenderrornoreturn with zend_error.