Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Hy when i try to install APC via pecl install APC-3.1.5 or even pecl install APC

I get following error when the package comes to the make command:

running: make
/bin/sh /var/tmp/pear-build-root/APC-3.1.5/libtool --mode=compile cc  -I. -I/var/tmp/APC -DPHP_ATOM_INC -I/var/tmp/pear-build-root/APC-3.1.5/include -I/var/tmp/pear-build-root/APC-3.1.5/main -I/var/tmp/APC -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  -DHAVE_CONFIG_H  -g -O2   -c /var/tmp/APC/apc.c -o apc.lo
mkdir .libs
 cc -I. -I/var/tmp/APC -DPHP_ATOM_INC -I/var/tmp/pear-build-root/APC-3.1.5/include -I/var/tmp/pear-build-root/APC-3.1.5/main -I/var/tmp/APC -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 -DHAVE_CONFIG_H -g -O2 -c /var/tmp/APC/apc.c  -fPIC -DPIC -o .libs/apc.o
In file included from /var/tmp/APC/apc.c:44:
/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:44:
/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'
/var/tmp/APC/apc.c:369: error: expected specifier-qualifier-list before 'pcre'
/var/tmp/APC/apc.c: In function 'apc_regex_compile_array':
/var/tmp/APC/apc.c:430: error: 'apc_regex' has no member named 'preg'
/var/tmp/APC/apc.c:430: error: 'apc_regex' has no member named 'preg'
/var/tmp/APC/apc.c:431: error: 'apc_regex' has no member named 'nreg'
/var/tmp/APC/apc.c:431: error: 'apc_regex' has no member named 'nreg'
/var/tmp/APC/apc.c: In function 'apc_regex_match_array':
/var/tmp/APC/apc.c:463: error: 'apc_regex' has no member named 'preg'
/var/tmp/APC/apc.c:463: error: 'apc_regex' has no member named 'preg'
/var/tmp/APC/apc.c:464: error: 'apc_regex' has no member named 'nreg'
/var/tmp/APC/apc.c:464: error: 'apc_regex' has no member named 'nreg'
make: *** [apc.lo] Error 1
ERROR: `make' failed

Can someone help me out with this????

I installed all posible mising things... like

yum install php-devel httpd-devel

yum groupinstall ‘Development Tools’

yum groupinstall ‘Development Libraries’

and still nothing... ~.~

share|improve this question

4 Answers 4

Try

yum install pcre-devel

before installing APC.

On Debian use

aptitude install libpcre3-dev

instead.

share|improve this answer
10  
+1 this worked for me, should be the accepted solution –  iainlbc Mar 18 '11 at 19:59
    
Same, thanks so much! –  McAden Nov 4 '11 at 1:36
    
worked like a charm... –  Okeke Emmanuel Oluchukwu Jul 25 '12 at 12:00
    
+1 - solved my issue. Thanks! –  Yuriy Babenko May 31 '13 at 18:53
    
+1 this worked for me, should be the accepted solution. Thanks –  eFriend Nov 18 at 0:53

I would compile from source. Make sure you delete anything that the package installers left behind. You probably have old extension directories laying around from older php versions. rm -rf them and their contents so you wont have any confusion.

cd ~ 
mkdir setups
cd setups 
wget http://pecl.php.net/get/APC-3.1.9.tgz 
tar -xvf APC-3.1.9.tgz 
cd APC-3.1.9
phpize
./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/local/bin/php-config
make

For the config= argument, run which php, and add -config to the result

If you get this error (Same as one you posted)

In file included from /usr/local/src/APC-3.1.5/apc.c:38: /usr/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory In file included from /usr/local/src/APC-3.1.5/apc.c:38: /usr/include/php/ext/pcre/php_pcre.h:45: error: expected '=', ',', ';', 'asm' or 'attribute' before '*' token /usr/include/php/ext/pcre/php_pcre.h:46: error: expected '=', ',', ';', 'asm' or 'attribute' before '*' token /usr/include/php/ext/pcre/php_pcre.h:52: error: expected specifier-qualifier-list before 'pcre' /usr/local/src/APC-3.1.5/apc.c:362: error: expected specifier-qualifier-list before 'pcre' /usr/local/src/APC-3.1.5/apc.c: In function 'apc_regex_compile_array': /usr/local/src/APC-3.1.5/apc.c:419: error: 'apc_regex' has no member named 'preg' /usr/local/src/APC-3.1.5/apc.c:419: error: 'apc_regex' has no member named 'preg' /usr/local/src/APC-3.1.5/apc.c:420: error: 'apc_regex' has no member named 'nreg' /usr/local/src/APC-3.1.5/apc.c:420: error: 'apc_regex' has no member named 'nreg' /usr/local/src/APC-3.1.5/apc.c: In function 'apc_regex_match_array': /usr/local/src/APC-3.1.5/apc.c:452: error: 'apc_regex' has no member named 'preg' /usr/local/src/APC-3.1.5/apc.c:452: error: 'apc_regex' has no member named 'preg' /usr/local/src/APC-3.1.5/apc.c:453: error: 'apc_regex' has no member named 'nreg' /usr/local/src/APC-3.1.5/apc.c:453: error: 'apc_regex' has no member named 'nreg' make: * [apc.lo] Error 1

Then you have to install pcre and make sure it's from the / directory or it will not install.

yum install pcre-devel

make
make install
share|improve this answer
    
If you get a warning about the --with-apxs flag, you can ignore it. –  Joseph Lust May 28 '12 at 21:00

it looks like you are trying to install APC on a system running PHP < 5.2.x. Version 3.1 of APC requires 5.2.x. I'm assuming your running CentOS 5.5 which ships with PHP 5.1.x.

try compiling and installing APC 3.0.19 from http://pecl.php.net/package/APC. We have had success deploying APC 3.0 on our CentOS servers.

share|improve this answer
1  
No I have php 5.3.3 installed and still the pecl wont install it correctly... i think their repo is corrupted. I had as you suggested to manually compile it. –  sangoku Nov 29 '10 at 11:51
    
@sangoku : me too struck with the same. if you got any solution plz share here. my php version is 5.3.2 and gets this error procedure entry point pcre_exe could not be located –  RSK Nov 30 '10 at 9:01

In Ubuntu:

aptitude install libpcre3-dev

And then:

pecl install apc
share|improve this answer
    
No new information (TM). Downvoting. –  Deer Hunter Jun 14 '13 at 21:48
    
Thanks man. For Ubuntu users that's a useful information. I could not comment on the previous answer (comments are still disabled for me, i can only answer). –  e.a. Jun 14 '13 at 22:09
    
thanks. Could not find what is wrong with my ubuntu. Helped me. –  shukshin.ivan May 29 at 11:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.