We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Zephir Error : Unable to load dynamic library '/usr/lib/php5/20121212/utils.so'

Hi, I'm a PHP developer. I really like the Zephir project. It's just an awesome tool, who want build C-Extension of their PHP application/modules.

Today, i installed 'Zephir' on my ubuntu machine. After spending some hour(going through zephir docs) with Zephir I noticed 2 things.

  • The 'config.json' file which suppose to be created inside of "utlis" folder(as of zephir doc) it's getting created outside of "utlis" folder.
  • After successfully testing 1st example 'Greeting'(as of zephir doc ) when i created the 2nd example of "Filter" Class & tried to build the extension by "zephir build" command i got following error..

Error message : PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/utils.so' - /usr/lib/php5/20121212/utils.so: undefined symbol: zephir_Utils_Bark_init in Unknown on line 0

In fact, i feel whenever i tried to create a new Class inside "utlis" folder i got that error. I made some quick google search about the error but didn't get any result.

Guys any idea, what's going wrong... ?



58.4k

Hi I think you must to upload file utils.zep, that useful solve problem for you

edited Mar '14

Hi Duythien, thanks for your quick response. But, i can't able to understand.. which file to upload & where.. ?

Actually, my folder/files structure is like this..

-utils
---ext
------All files of 'ext' folder
---utils
------filter.zep
------greeting.zep

So, can you help me to understand which file(filter.zep/greeting.zep) i need to upload & at where ? Actually, i was going through the zephir docs (https://zephir-lang.com/tutorial.html).



58.4k
Accepted
answer
edited Mar '14

@mi6crazyheart I test filter.zep and success,but the first complie not workking i try the second the success( i am use Ubuntu 12.04)

    cd utils && zephir compile
    cd  ext
    phpize
   ./configure 
    make
   sudo make install
edited Mar '14

@duythien Thx a lot. I exactly couldn't able to understand your english but your given CODES did the magic. Now, that error has removed. It's working fine. Thanks a once again for your quick response.

One more thing i want to tell to Zephir Docs owner.. the following code

$f = new Utils\Filter();
echo $f->alpha("$he$02l3'121lo."); // prints "hello"

should be changed to..

$f = new Utils\Filter();
echo $f->alpha("he$02l3'121lo."); // prints "hello" ---$ SIGN REMOVED from String---

ELSE , with '$' sign it is printing "llo". Because, with '$' sign PHP take it as a variable.