pcre.h: No such file or directory Error while Installing Alternative PHP Cache [Solved]

Updated on September 3, 2017

Question : Hi techglimpse, thanks for answering my previous query on phpize. Now I’m stuck with another error while installing APC – pcre.h: No such file or directory. This error occurred when I used pecl command to install APC as below:

# pecl install apc
ARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-upd
ate pecl.php.net" to update
downloading APC-3.1.13.tgz ...
Starting to download APC-3.1.13.tgz (171,591 bytes)
.....................................done: 171,591 bytes
55 source files, building
running: phpize
::::::::::::::::::::
running: make
::::::::::::::::::::

Below is the snapshot of the Error during ‘make’

/usr/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory
In file included from /var/tmp/APC/apc.c:45:
/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-lis
t before âpcreâ
/var/tmp/APC/apc.c:449: error: expected specifier-qualifier-list before âpcreâ
/var/tmp/APC/apc.c: In function âapc_regex_compile_arrayâ:
/var/tmp/APC/apc.c:510: error: âapc_regexâ has no member named âpregâ
/var/tmp/APC/apc.c:510: error: âapc_regexâ has no member named âpregâ
/var/tmp/APC/apc.c:511: error: âapc_regexâ has no member named ânregâ
/var/tmp/APC/apc.c:511: error: âapc_regexâ has no member named ânregâ
/var/tmp/APC/apc.c: In function âapc_regex_match_arrayâ:
/var/tmp/APC/apc.c:552: error: âapc_regexâ has no member named âpregâ
/var/tmp/APC/apc.c:552: error: âapc_regexâ has no member named âpregâ
/var/tmp/APC/apc.c:553: error: âapc_regexâ has no member named ânregâ
/var/tmp/APC/apc.c:553: error: âapc_regexâ has no member named ânregâ
make: *** [apc.lo] Error 1
ERROR: `make' failed

Please help me to fix this error – Thanks Maneesh.

apc install error

Solution:

The error means that you don’t have ‘pcre-devel‘ installed. Run the below command.

On CentOS, RHEL machine:

# yum install pcre-devel

On Ubuntu, Debian – use apt-get:

# apt-get install libpcre3-dev

That should fix pcre.h not found error.

Was this article helpful?

Related Articles

Leave a Comment