We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Compilation failure: v1.3.0


I'm getting a compilation error when trying to compile v1.3.0.

  • I cloned the latest 1.3.0 just a few minutes ago.
  • I'm installing on the latest version of Debian
  • I have the php5-dev package installed.
  • I have no problem when compiling v1.2.3

libtool: compile: gcc -I. -I/home/anded/cphalcon/build/64bits -DPHP_ATOM_INC -I/home/anded/cphalcon/build/64bits/include -I/home/anded/cphalcon/build/64bits/main -I/home/anded/cphalcon/build/64bits -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -march=native -mtune=native -O2 -fno-delete-null-pointer-checks -finline-functions -fomit-frame-pointer -fno-builtin-memcmp -fvisibility=hidden -c /home/anded/cphalcon/build/64bits/phalcon.c -fPIC -DPIC -o .libs/phalcon.o

In file included from /usr/include/php5/ext/spl/spl_iterators.h:27:0, from /home/anded/cphalcon/build/64bits/phalcon.c:193: /usr/include/php5/ext/pcre/php_pcre.h:29:18: fatal error: pcre.h: No such file or directory compilation terminated.

I am not sure what the package name is for Debian but for Ubuntu you need to install:

apt-get install libpcre3-dev

Yep, that did it. Is that a new requirement of 1.3.0?


Phalcon now make direct calls to the PCRE binary functions instead of calling them in the PHP userland.

So I guess this is just a "bleeding-edge" problem due to me compiling a version that doesn't have released directions. Fair enough.


I'm stuck on CentOS 6.5 because the PCRE version is 7.8-6.el6 and compiling Phalcon fails with:

/usr/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory
In file included from /usr/include/php/ext/spl/spl_iterators.h:27,
                 from /home/brian/phalcon1.30/cphalcon/build/64bits/phalcon.c:204:
/usr/include/php/ext/pcre/php_pcre.h:37: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/usr/include/php/ext/pcre/php_pcre.h:38: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/usr/include/php/ext/pcre/php_pcre.h:44: error: expected specifier-qualifier-list before ‘pcre’
make: *** [phalcon.lo] Error 1

Is PCRE 8.x required?


You need to install pcre dependencies:

sudo yum install php-devel pcre-devel gcc make


Thanks for the lightning fast response. That did the trick!


Installed Phaclom this morning on ubuntu 13.10. Had the same issue. Requirements section of the installation documentation seems to be outdated as far as pcre is concerned.

Strange, the phalcon/docs repo has the updated text. Seems like the docs weren't updated by the newest commits. @phalcon @xboston

when i try to install "libpcre3-dev" ubuntu 14.04 give error

Reading package lists... Done Building dependency tree
Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: libpcre3-dev : Depends: libpcre3 (= 1:8.31-2ubuntu2) but 1:8.31- 2ubuntu2.1 is to be installed Depends: libpcrecpp0 (= 1:8.31-2ubuntu2) but 1:8.31-2ubuntu2.1 is to be installed E: Unable to correct problems, you have held broken packages.