APC stands for “Alternative PHP Cache”. APC is a free, open, and robust framework for caching and optimizing PHP intermediate code. This article shows common problems when installing APC and how to fix them.
- Installing is as simple as
[root@search ~]# pecl install apc [root@search ~]# echo "extension=apc.so" > /etc/php.d/apc.ini
- pcre.h: No such file or directory when installing APC (PHP extension)
- Error is as follows:
/usr/include/php5/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory
- To fix:
yum install pcre-devel
- Error is as follows:
- Cannot execute on /tmp
- Error is as follows:
shtool at '/tmp/APC/build/shtool' does not exist or is not executable. Make sure that the file exists and is executable and then rerun this script.
- To fix: allow exec, and then disallow this permission on /tmp after installation
mount -o remount,exec /tmp .... mount -o remount,noexec /tmp
- Error is as follows:
- sh: phpize: command not found
- yum install php-devel
- no acceptable C compiler found in $PATH
- yum install gcc
- Error related to specifier-qualifier-list 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’
- yum install pcre-devel