The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

APC install error

Discussion in 'General Discussion' started by tomdchi, Nov 17, 2010.

  1. tomdchi

    tomdchi Well-Known Member

    Joined:
    Feb 24, 2008
    Messages:
    116
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    cPanel Access Level:
    DataCenter Provider
    I get the error below when trying to install APC via WHM PECL installer

    Anyone have any idea how to fix this?

    Code:
    
    running: make
    /bin/sh /root/tmp/pear-build-root/APC-3.0.19/libtool --mode=compile cc -m64 -fPIC -DPIC -I. -I/root/tmp/pear/APC -DPHP_ATOM_INC -I/root/tmp/pear-build-root/APC-3.0.19/include -I/root/tmp/pear-build-root/APC-3.0.19/main -I/root/tmp/pear/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 /root/tmp/pear/APC/apc.c -o apc.lo
    mkdir .libs
     cc -m64 -fPIC -DPIC -I. -I/root/tmp/pear/APC -DPHP_ATOM_INC -I/root/tmp/pear-build-root/APC-3.0.19/include -I/root/tmp/pear-build-root/APC-3.0.19/main -I/root/tmp/pear/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 /root/tmp/pear/APC/apc.c  -fPIC -DPIC -o .libs/apc.o
    /bin/sh /root/tmp/pear-build-root/APC-3.0.19/libtool --mode=compile cc -m64 -fPIC -DPIC -I. -I/root/tmp/pear/APC -DPHP_ATOM_INC -I/root/tmp/pear-build-root/APC-3.0.19/include -I/root/tmp/pear-build-root/APC-3.0.19/main -I/root/tmp/pear/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 /root/tmp/pear/APC/php_apc.c -o php_apc.lo
     cc -m64 -fPIC -DPIC -I. -I/root/tmp/pear/APC -DPHP_ATOM_INC -I/root/tmp/pear-build-root/APC-3.0.19/include -I/root/tmp/pear-build-root/APC-3.0.19/main -I/root/tmp/pear/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 /root/tmp/pear/APC/php_apc.c  -fPIC -DPIC -o .libs/php_apc.o
    /root/tmp/pear/APC/php_apc.c:959: error: duplicate 'static'
    make: *** [php_apc.lo] Error 1
    ERROR: `make' failed
    The APC.so object is not in /usr/local/lib/php/extensions/no-debug-non-zts-20090626
    
    
     
  2. tomdchi

    tomdchi Well-Known Member

    Joined:
    Feb 24, 2008
    Messages:
    116
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    cPanel Access Level:
    DataCenter Provider
    [SOLVED]APC install error

    After a week I finally got it worked out. Aparently this is a common problem and I thought I would share how I got it to work since I had to cobble together different steps from different sources to get it to install.

    Server set up: cPanel/WHM, Centos 5.5, with php 5.3.3

    If you are trying to install APC are not able to using the WHM PECL installer then try this. APC needs to be installed from source so these instructions assume you have root access to the server using a client like putty.

    login to server as root and run the following commands:

    Code:
    cd ~ 
    mkdir setups
    cd setups 
    wget http://pecl.php.net/get/APC-3.1.5.tgz 
    tar -xvf APC-3.1.5.tgz 
    cd APC-3.1.5
    phpize
    ./configure --enable-apc --enable-apc-mmap --with-apxs --with-php config=/usr/local/bin/php-config
    make
    
    if you get the error:
    Code:
    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 need to install pcre and make sure you do this from the / directory or it will not install.
    Code:
    yum install pcre-devel
    
    Again do:
    Code:
    make
    
    If no errors then do:
    Code:
    make install
    
    update php.ini through WHM PHP Configuration Editor. Switch to Advanced and find Section:Core Directive:extension and add this to the end of the list:
    Code:
    , apc.so
    
    Then restart apache and your done. the phpinfo function should show that APC is installed

    Hope this helps someone.
     
  3. fshagan

    fshagan Member

    Joined:
    Jan 29, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Fantastic ... thanks for this!
     
  4. garrettp

    garrettp Well-Known Member
    PartnerNOC

    Joined:
    Jun 18, 2004
    Messages:
    312
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    Re: [SOLVED]APC install error

    Just a note here, you couldn't build the WHM APC because the version the WHM was pulling from it's PECL repo that was stable at the time (3.0.19) did not support PHP 5.3.x. It wasn't until the APC 3.1 betas that PHP 5.3.x was supported.

    APC is now stable at 3.1.6, has full PHP 5.3.x support, and this is the version now installed by the WHM PECL installer.
     
  5. luigidelgado

    luigidelgado Well-Known Member

    Joined:
    Nov 6, 2010
    Messages:
    109
    Likes Received:
    2
    Trophy Points:
    16
    Location:
    Mexico
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hummm.... I have updated all my WHM/cPanel Software but I can't find APC anywhere... nor in "PHP Pecl" nor in "PHP Extensions and Applications Package"... am I missing something??

    I read about APC and it's a great performance extension. Good to know PHP 6 will have it by default.
     
  6. hbouma

    hbouma Well-Known Member

    Joined:
    Jun 8, 2002
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    Re: [SOLVED]APC install error

    Because cPanel installs its own version of pcre that it uses to build PHP, don't you run the risk of using a different version of pcre when you do this which may cause problems? Why not just find a way to use the version in /opt that cpanel is using for building apache/php ?

    Actually, WHM wants to install 3.1.7 which is the beta version when I try it from there. It would be nice if they didn't try to pull beta versions from the pecl repo.

    Hal
     
  7. luigidelgado

    luigidelgado Well-Known Member

    Joined:
    Nov 6, 2010
    Messages:
    109
    Likes Received:
    2
    Trophy Points:
    16
    Location:
    Mexico
    cPanel Access Level:
    Root Administrator
    Twitter:
    Re: [SOLVED]APC install error

    Depends on your UPDATE settings, if you have preference for STABLE versions you will get 3.1.6...

    Still having some dificulties here... I finally just placed "APC" in the Pecl SEARCH in cPanel and installation began but had errors with CLI, does anybody know how may I solve this?:

    Code:
    downloading APC-3.1.6.tgz ...
    Starting to download APC-3.1.6.tgz (148,835 bytes)
    .............done: 148,835 bytes
    49 source files, building
    running: phpize
    Configuring for:
    PHP Api Version:         20090626
    Zend Module Api No:      20090626
    Zend Extension Api No:   220090626
    Enable per request file info about files used from the APC cache [no] : 
    [COLOR="red"]Notice: Use of undefined constant STDIN - assumed 'STDIN' in PEAR/Frontend/CLI.php on line 304
    
    Warning: fgets() expects parameter 1 to be resource, string given in PEAR/Frontend/CLI.php on line 304
    
    Warning: fgets() expects parameter 1 to be resource, string given in /usr/lib/php/PEAR/Frontend/CLI.php on line 304
    Enable spin locks (EXPERIMENTAL) [no] : 
    Notice: Use of undefined constant STDIN - assumed 'STDIN' in PEAR/Frontend/CLI.php on line 304
    
    Warning: fgets() expects parameter 1 to be resource, string given in PEAR/Frontend/CLI.php on line 304
    
    Warning: fgets() expects parameter 1 to be resource, string given in /usr/lib/php/PEAR/Frontend/CLI.php on line 304[/COLOR]
    building in /root/tmp/pear/pear-build-root8jbTu8/APC-3.1.6
    running: /root/tmp/pear/APC/configure --enable-apc-filehits=no --enable-apc-spinlocks=no
    checking for egrep... grep -E
    checking for a sed that does not truncate output... /bin/sed
    checking for cc... cc
    checking for C compiler default output file name... a.out
    checking whether the C compiler works... yes
    checking whether we are cross compiling... no
    checking for suffix of executables...
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether cc accepts -g... yes
    checking for cc option to accept ANSI C... none needed
    checking how to run the C preprocessor... cc -E
    checking for icc... no
    checking for suncc... no
    checking whether cc understands -c and -o together... yes
    checking for system library directory... lib
    checking if compiler supports -R... no
    checking if compiler supports -Wl,-rpath,... yes
    checking build system type... x86_64-unknown-linux-gnu
    checking host system type... x86_64-unknown-linux-gnu
    checking target system type... x86_64-unknown-linux-gnu
    checking for PHP prefix... /usr
    checking for PHP includes... -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
    checking for PHP extension directory... /usr/lib/php/extensions/no-debug-non-zts-20090626
    checking for PHP installed headers prefix... /usr/include/php
    checking if debug is enabled... no
    checking if zts is enabled... no
    checking for re2c... re2c
    checking for re2c version... invalid
    configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
    checking for gawk... gawk
    checking whether to enable APC support... yes, shared
    checking whether we should enable cache request file info... no
    checking whether we should use mmap... yes
    checking whether we should use semaphore locking instead of fcntl... no
    checking whether we should use pthread mutex locking... yes
    pthread mutex's are supported!
    checking whether we should use spin locks... no
    checking whether we should enable memory protection... no
    checking for zend_set_lookup_function_hook... no
    checking for sigaction... yes
    checking for union semun... no
    checking whether we should enable valgrind support... checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    yes
    checking valgrind/memcheck.h usability... no
    checking valgrind/memcheck.h presence... no
    checking for valgrind/memcheck.h... no
    checking for shm_open in -lrt... yes
    checking for ld used by cc... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking for /usr/bin/ld option to reload object files... -r
    checking for BSD-compatible nm... /usr/bin/nm -B
    checking whether ln -s works... yes
    checking how to recognize dependent libraries... pass_all
    checking dlfcn.h usability... yes
    checking dlfcn.h presence... yes
    checking for dlfcn.h... yes
    checking the maximum length of command line arguments... 98304
    checking command to parse /usr/bin/nm -B output from cc object... ok
    checking for objdir... .libs
    checking for ar... ar
    checking for ranlib... ranlib
    checking for strip... strip
    checking if cc supports -fno-rtti -fno-exceptions... no
    checking for cc option to produce PIC... -fPIC
    checking if cc PIC flag -fPIC works... yes
    checking if cc static flag -static works... yes
    checking if cc supports -c -o file.o... yes
    checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
    checking whether -lc should be explicitly linked in... no
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... no
    
    creating libtool
    appending configuration tag "CXX" to libtool
    configure: creating ./config.status
    config.status: creating config.h
    running: make
    /bin/sh /root/tmp/pear/pear-build-root8jbTu8/APC-3.1.6/libtool --mode=compile cc  -I. -I/root/tmp/pear/APC -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-root8jbTu8/APC-3.1.6/include -I/root/tmp/pear/pear-build-root8jbTu8/APC-3.1.6/main -I/root/tmp/pear/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 /root/tmp/pear/APC/apc.c -o apc.lo
    mkdir .libs
     cc -I. -I/root/tmp/pear/APC -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-root8jbTu8/APC-3.1.6/include -I/root/tmp/pear/pear-build-root8jbTu8/APC-3.1.6/main -I/root/tmp/pear/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 /root/tmp/pear/APC/apc.c  -fPIC -DPIC -o .libs/apc.o
    In file included from /root/tmp/pear/APC/apc.c:44:
    [COLOR="red"]/usr/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory
    In file included from /root/tmp/pear/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'
    /root/tmp/pear/APC/apc.c:369: error: expected specifier-qualifier-list before 'pcre'
    /root/tmp/pear/APC/apc.c: In function 'apc_regex_compile_array':
    /root/tmp/pear/APC/apc.c:430: error: 'apc_regex' has no member named 'preg'
    /root/tmp/pear/APC/apc.c:430: error: 'apc_regex' has no member named 'preg'
    /root/tmp/pear/APC/apc.c:431: error: 'apc_regex' has no member named 'nreg'
    /root/tmp/pear/APC/apc.c:431: error: 'apc_regex' has no member named 'nreg'
    /root/tmp/pear/APC/apc.c: In function 'apc_regex_match_array':
    /root/tmp/pear/APC/apc.c:463: error: 'apc_regex' has no member named 'preg'
    /root/tmp/pear/APC/apc.c:463: error: 'apc_regex' has no member named 'preg'
    /root/tmp/pear/APC/apc.c:464: error: 'apc_regex' has no member named 'nreg'
    /root/tmp/pear/APC/apc.c:464: error: 'apc_regex' has no member named 'nreg'
    make: *** [apc.lo] Error 1
    ERROR: `make' failed[/COLOR]
    The apc.so object is not in /usr/local/lib/php/extensions/no-debug-non-zts-20090626
    BTW... I havent [SOLVED] it... APC install problems is one of the most indexed thems for APC in Google... After a clean install APC is the Perfect Choice.

    I need all performance available, i run a fat-of-images-million-visit-news site.
     
    #7 luigidelgado, Apr 3, 2011
    Last edited: Apr 3, 2011
  8. garrettp

    garrettp Well-Known Member
    PartnerNOC

    Joined:
    Jun 18, 2004
    Messages:
    312
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    Re: [SOLVED]APC install error

    My PECL installer on 11.28.87-CURRENT_51188 wants to install 3.1.6. You may want to check your PECL configuration to see if it's set to pull beta/unstable releases.

    Code:
    12:08:57-root@xxx:~$ pecl config-show|grep "Preferred Package State"
    Preferred Package State        preferred_state  stable
     
  9. garrettp

    garrettp Well-Known Member
    PartnerNOC

    Joined:
    Jun 18, 2004
    Messages:
    312
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    Re: [SOLVED]APC install error

    What version of PHP? The fact that phpize is throwing PHP errors tells me there may be an issue with the PHP environment.
     
  10. luigidelgado

    luigidelgado Well-Known Member

    Joined:
    Nov 6, 2010
    Messages:
    109
    Likes Received:
    2
    Trophy Points:
    16
    Location:
    Mexico
    cPanel Access Level:
    Root Administrator
    Twitter:
    Garret,

    I just upgraded to 5.3.6... no errors after upgrade... upgraded via EasyApache Compiler
     
  11. garrettp

    garrettp Well-Known Member
    PartnerNOC

    Joined:
    Jun 18, 2004
    Messages:
    312
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    Good deal :)
     
  12. luigidelgado

    luigidelgado Well-Known Member

    Joined:
    Nov 6, 2010
    Messages:
    109
    Likes Received:
    2
    Trophy Points:
    16
    Location:
    Mexico
    cPanel Access Level:
    Root Administrator
    Twitter:
    Well not at all... did appear errors same thing...
    :(
     
  13. villario

    villario Registered

    Joined:
    Dec 10, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    tried pecl install apc and got the errors as above. I then tried the suggestion yum install pcre-devel which installed PCRE again into 5.3.3 and then tried pecl install apc again, and it worked! Thanks tomdchi!
     
  14. Douglas Taylor

    Joined:
    Oct 18, 2011
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United States
    cPanel Access Level:
    Root Administrator
    I tried the install tonight and received the following error. Granted, I'm also running Xcache for a different reason on a dedicated server but...

    moz-screenshot-1.png
     
  15. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Do you have any RLimitMEM set on the server?

    Code:
    grep -i rlimit /usr/local/apache/conf/httpd.conf
     
  16. Douglas Taylor

    Joined:
    Oct 18, 2011
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United States
    cPanel Access Level:
    Root Administrator
    The result is:

    ServerLimit 256
     
  17. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    If you are only getting a ServerLimit not RLimitMEM, then you aren't restricted by RLimit for memory on the machine.
     
  18. Douglas Taylor

    Joined:
    Oct 18, 2011
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United States
    cPanel Access Level:
    Root Administrator
    Waaaaaaay above my pay grade to understand what that means! :)
     
  19. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You are receiving a memory size allocation error, which ties into memory limits. One way to limit memory is RLimitMEM in Apache, which is one of the common reasons for that type of error message. Another reason would be a memory limit in /usr/local/lib/php.ini file:

    Code:
    grep ^memory /usr/local/lib/php.ini
     
  20. Douglas Taylor

    Joined:
    Oct 18, 2011
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United States
    cPanel Access Level:
    Root Administrator
    Looks like the result is:

    memory_limit = 32M
     
Loading...

Share This Page