Install PHP APC

Flexup

Verified User
Joined
Feb 26, 2012
Messages
40
Hello

I have read : http://help.directadmin.com/item.php?id=400

So i have tried, but when i "make" i have :

/usr/local/directadmin/custombuild/APC-3.1.13/apc_compile.c: In function ‘my_copy_class_entry’:
/usr/local/directadmin/custombuild/APC-3.1.13/apc_compile.c:755:9: warning: assignment from incompatible pointer type [enabled by default]
/usr/local/directadmin/custombuild/APC-3.1.13/apc_compile.c: In function ‘apc_copy_class_entry_for_execution’:
/usr/local/directadmin/custombuild/APC-3.1.13/apc_compile.c:1956:9: warning: assignment from incompatible pointer type [enabled by default]
/usr/local/directadmin/custombuild/APC-3.1.13/apc_compile.c: In function ‘apc_copy_trait_alias’:
/usr/local/directadmin/custombuild/APC-3.1.13/apc_compile.c:2379:12: error: ‘zend_trait_alias’ has no member named ‘function’
/usr/local/directadmin/custombuild/APC-3.1.13/apc_compile.c:2380:9: error: ‘zend_trait_alias’ has no member named ‘function’
/usr/local/directadmin/custombuild/APC-3.1.13/apc_compile.c:2380:9: error: ‘zend_trait_alias’ has no member named ‘function’
/usr/local/directadmin/custombuild/APC-3.1.13/apc_compile.c: In function ‘apc_copy_trait_precedence’:
/usr/local/directadmin/custombuild/APC-3.1.13/apc_compile.c:2416:12: error: ‘zend_trait_precedence’ has no member named ‘function’
/usr/local/directadmin/custombuild/APC-3.1.13/apc_compile.c:2417:9: error: ‘zend_trait_precedence’ has no member named ‘function’
/usr/local/directadmin/custombuild/APC-3.1.13/apc_compile.c:2417:9: error: ‘zend_trait_precedence’ has no member named ‘function’
make: *** [apc_compile.lo] Error 1

Anyone can help me ? :D

debian 7
php cli 5.5.21
 
Last edited:
A quick search on google told me that APC isn't supported anymore in PHP 5.5

PHP 5.5 has built-in opcode optimizer OPcache making APC obsolete.
According to APC changelogs, PHP up to only 5.4 is supported.
Please use OPcache with PHP 5.5+[FONT=Arial, Liberation Sans, DejaVu Sans, sans-serif]
[/FONT]

[FONT=Arial, Liberation Sans, DejaVu Sans, sans-serif]You can install OPcache with Custombuild 2.0 [/FONT]

[FONT=Arial, Liberation Sans, DejaVu Sans, sans-serif]
[/FONT]
[FONT=Arial, Liberation Sans, DejaVu Sans, sans-serif]open options.conf change opcache from no too yes[/FONT]
[FONT=Arial, Liberation Sans, DejaVu Sans, sans-serif]./build opcache[/FONT]
[FONT=Arial, Liberation Sans, DejaVu Sans, sans-serif]./build php n
[/FONT]

[FONT=Arial, Liberation Sans, DejaVu Sans, sans-serif]I don't know if the PHP step is necessary to work.[/FONT]
 
It can be done with CB 1.x and there are official tutorials: http://help.directadmin.com/item.php?id=400 .

These are my notes;
apc

[root@vps1 APC-3.1.13]# make install
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20100525/
Installing header files: /usr/local/include/php/

help
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613/"

correct:
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20100525/"

example
extension=apc.so
apc.enabled=1
apc.shm_size=1000M
apc.ttl=7200
apc.user_ttl=7200
apc.enable_cli=1
apc.max_file_size=5M

. A tip is to set apc.cache_by_default=0 in php.ini, and then apc.cache_by_default=1 in the .htaccess of websites requiring APC optimisation.

correct:
[APC]
extension=apc.so
apc.enabled=1
apc.shm_size=100M
apc.ttl=7200
apc.user_ttl=7200
apc.enable_cli=1
apc.max_file_size=5M
apc.cache_by_default=0

in .htaccess
php_flag apc.cache_by_default on
php_flag apc.cache_by_default 1

Personally I have switched to Php 5.5 witch opcache using Custombuild 2.0. However plugins like W3 totalcache are more flexible with APC installed because you can offload certain wordpress elements directly into the APC. With Opcache you lack that level of control and your opcache gets shared with EVERY website on your server. You cannot disable it by default.
 
Last edited:
Back
Top