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

Error during compilation time

Hello!

I've been trying to install phalcon along php 5.6 and it appears to install to compile properly but whenever I setup my nginx + php-fpm host it shows a 502 bad gateway only in the phalcon bootstraping index file. I tried to go deeper to se if it was an error of my php-fpm setup but I think its because this compilation error:

/home/ec2-user/cphalcon/build/64bits/phalcon.zep.c: In function 'pp_syntax_error':
/home/ec2-user/cphalcon/build/64bits/phalcon.zep.c:98723:0: warning: "TOKEN" redefined [enabled by default]
 #define TOKEN (ppminor.pp0)
 ^
/home/ec2-user/cphalcon/build/64bits/phalcon.zep.c:29228:0: note: this is the location of the previous definition
 #define TOKEN (aaminor.aa0)
 ^
/home/ec2-user/cphalcon/build/64bits/phalcon.zep.c: In function 'vv_syntax_error':
/home/ec2-user/cphalcon/build/64bits/phalcon.zep.c:116831:0: warning: "TOKEN" redefined [enabled by default]
 #define TOKEN (vvminor.vv0)
 ^
/home/ec2-user/cphalcon/build/64bits/phalcon.zep.c:98723:0: note: this is the location of the previous definition
 #define TOKEN (ppminor.pp0)

I've done this before successfully (the installation proccess) and never got something like that.

Update: I installed phalcon from the 2.0.0 zip and it now works properly, there must be something related with the 2.0.1 version in the git repo

+1 having the same exact issue, and resolved the same. This is on CentOS 7 fresh install.



24.8k

Same here on Ubuntu. Can't compile the version 2.0.1.


/home/work_dir/cphalcon/build/64bits/phalcon.zep.c: In function 'pp_syntax_error':
/home/work_dir/cphalcon/build/64bits/phalcon.zep.c:98723:0: warning: "TOKEN" redefined [enabled by default]
 #define TOKEN (ppminor.pp0)
 ^
/home/work_dir/cphalcon/build/64bits/phalcon.zep.c:29228:0: note: this is the location of the previous definition
 #define TOKEN (aaminor.aa0)
 ^
/home/work_dir/cphalcon/build/64bits/phalcon.zep.c: In function 'vv_syntax_error':
/home/work_dir/cphalcon/build/64bits/phalcon.zep.c:116831:0: warning: "TOKEN" redefined [enabled by default]
 #define TOKEN (vvminor.vv0)
 ^
/home/work_dir/cphalcon/build/64bits/phalcon.zep.c:98723:0: note: this is the location of the previous definition
 #define TOKEN (ppminor.pp0)
 ^
virtual memory exhausted: Cannot allocate memory
make: *** [phalcon.lo] Error 1
edited May '15

@stephane It means you don't have enough memory to compile Phalcon, try adding more swap to your system or compile from ext/

git clone https://github.com/phalcon/cphalcon
cd cphalcon/ext
sudo ./install


24.8k

Thanks for the quick answer, you guys are always fast on the forum. It works just fine now.

I suggest you should update the readme/compilation instructions on github, it shows:

git clone git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install

@stephane Compilation instructions in the README are the recommended instructions

Something must be terrible wrong if some box runs out of RAM during compile....

@stephane It means you don't have enough memory to compile Phalcon, try adding more swap to your system or compile from ext/

git clone https://github.com/phalcon/cphalcon
cd cphalcon/ext
sudo ./install