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 on OS X

I've check out the project and install the requirements via MacPorts. The XX folder is not there so I tried to run generate. I got this error:

parser.c:10:23: error: json/json.h: No such file or directory

So I think I have a path issues, but I have no idea how to fix it.

Any thoughts?



98.9k

You need to install json-c on your machine: https://github.com/phalcon/zephir#installation

However, Zephir is not ready to be used yet , it's very alpha and it has several missing features and bugs

Here is my progress so far.

The json-c package that comes with MacPorts was no good. I just followed the instructions here https://github.com/json-c/json-c/blob/master/README and that issues was resolved.

I have Zend Server. when I ran the ext/install it used the wrong phpize. I just get rid the one that ships with OS X that is in /usr/bin.

Everything seemed to build OK, but I'm getting a "wrong architecture" error. when trying to use the complied extension.

I'll try some more and update when I make progress.

I understand this is early days, I'm just very excited about the idea and wanted to get my hands dirty.

edited Mar '14

So the issue with "wrong architecture" was that while I'm on a 64bit OS Zend Server's PHP is complied in 32 bit. The solution was to run install like so:

sudo CFLAGS=-m32 CPPFLAGS=-m32 CCASFLAGS=-m32 ./install

I can run all the unit test files without error:

$ php ../unit-tests/arithmetic.php 
$ php ../unit-tests/fibonacci.php:
$ php ../unit-tests/flow.php 
$ php ../unit-tests/nativearray.php