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

Problem installing on Centos 6.X

Hi

I've been having problems installing phalcon lately. It happened on a Centos 6.5 and then on a Centos 6.6.

PHP ver is 7.0.14 gcc ver is 4.4.7

The error I'm getting is this:

config.status: executing libtool commands /bin/sh /root/cphalcon/build/php7/64bits/libtool --mode=compile gcc -I. -I/root/cphalcon/build/php7/64bits -DPHP_ATOM_INC -I/root/cphalcon/build/php7/64bits/include -I/root/cphalcon/build/php7/ 64bits/main -I/root/cphalcon/build/php7/64bits -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
-DPHALCON_RELEASE -DHAVE_CONFIG_H -march=native -mtune=native -O2 -fomit-frame-pointer -fvisibility=hidden -c /root/cphalcon/build/php7/64bits/phalcon.zep.c -o phalcon.lo libtool: compile: gcc -I. -I/root/cphalcon/build/php7/64bits -DPHP_ATOM_INC -I/root/cphalcon/build/php7/64bits/include -I/root/cphalcon/build/php7/64bits/main -I/root/cphalcon/build/php7/64bits -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DPHALCON_RELEASE -DHAVE_CONFIG_H -march=native -mtune=native -O2 -fomit-frame-pointer -fvisibility=hidden -c /root/cphalcon/build/php7/64bits/phalcon.zep.c -fPIC -DPIC -o .libs/phalcon.o gcc: Internal error: Killed (program cc1) Please submit a full bug report. See https://bugzilla.redhat.com/bugzilla for instructions. make: *** [phalcon.lo] Error 1

Now, I've searched and found that this could happen because of low memory during compilation, but the 6.6 machine is brand new, had 1GB free memory when I was installing. I also tried compiling from cphalcon/ext but it threw a different error.

What could be the problem?

Yea exactly this means not enough memory. Then post here this diffrent error. Just disable applications like nginx, apache, mysql to free same ram and/or add swap.



3.6k

Hi

Maybe I didn't explain myself well, english is not my first language.

The last time this happened to me, was on a virtual machine on the amazon cloud. The vm has 1GB of memory, and nothing was running on it, the entire memory (besides de OS, Centos 6.6) was free.

Does phalcon really need 1GB to compile? I really can't think that would be it. The VM has no swap, maybe that's the problem?

Thanks



145.0k
Accepted
answer

Using build folder i think yes, 1gb to compile. Then try to add swap.



3.6k

Well yeah, that was it, tried on another machine, same versions but more memory, and it worked.

Thanks, I had read about the memory thing, I just couldn't believe you needed that much to compile it

I must disagree about this memory myth which happens only on CentOS for some reason (bloatware?). Phalcon compiles easily with only 512 MB of RAM on a very low powered hardware (RPI), Debian/GNU Linux.

With 1 GB it should compile w/o issues unlesss your machine is currently heavily using RAM for other services such as database. In that case stop those heavy consumers first and then compile.

Compiling C sources is not that much memory hungry procedure, otherwise you wouldn't be able to compile PHP itself at first place.

Simple comparison: PHP source is like 50x bigger than Phalcon's, and still can compile with 512MB of RAM w/o touching any swap (swap off).