Build error: fatal error: pcre.h: no such file or directory

I just finished installing Ubuntu 13.10.

I want to try Phalcon, and when I create the source (phalcon.so), I have this error:

from /home/fabrice/Downloads/cphalcon/build/32bits/phalcon.c:204: /usr/include/php5/ext/pcre/php_pcre.h:29:18: fatal error: pcre.h: No such file or directory #include "pcre.h" ^ compilation terminated. make: *** [phalcon.lo] Erreur 1 

My lamp installation:

sudo apt-get install -y apache2 php5 mysql-server libapache2-mod-php5 php5-mysql php5-curl php5-imagick php5-mcrypt php5-memcache php5-sqlite php5-xdebug php-apc php5-intl php-mongo php gcc

Can someone help me?

+59
php build ubuntu phalcon
Mar 21 '14 at 10:00
source share
3 answers

The latest version of Phalcon uses the PCRE libraries.

You can install them like this:

 sudo apt-get install libpcre3-dev 

and then try installing Phalcon again

For CentOS you will need to use

 sudo yum install pcre-devel 

Credits: @ xgretsch

For mac you can use

 brew install pcre 

Credits @ Brandon Romano

+172
Mar 21 '14 at 13:20
source share

To include the pcre.h file, search the package archives for the pcre.h file. To do this, I use the apt-file (

apt-get install apt-file

and

Update apt file

if you did not install it).

Then search for pcre package:

apt-file search -x "/pcre.h $"

-x tells the command that I want to use the regular expression as a template. apt-file provided me with three hits:

  • kannel-dev: /usr/include/kannel/gwlib/pcre.h
  • libajax6-dev: /usr/include/ajax/pcre.h
  • libpcre3-dev: /usr/include/pcre.h

The latter is the one I want:

apt-get install libpcre3-dev

This will solve the problem with the compilation of the pcre.h file. Hope this helps others who can come to find an answer on this topic.

+9
Dec 10 '15 at 9:11
source share

For mac osx maverick you can use

 brew install pcre 

if he gives you an error you can use

 sudo ln -s /opt/local/include/pcre.h /usr/include/ sudo pecl install apc 
+1
Jun 01 '16 at 12:37
source share



All Articles