HOW-TO: Install APC

btw, for people having trouble loading pages a few seconds after Apache's restart...
Comment the ZEND-lines in php.ini to turn that off..

Seems that the two don't work well together.


edit:

Unless you turn off the file-caching part in APC, then you can run Zend next to it ;)
To do so, set apc.cache_by_default=0
(and keep the filtering part default, so no match and therewith file-caching will occur by APC)

This means you can keep Zend and use APC for string/array/script caching, which I think Zend doesn't support.
 
Last edited:
phpize

Hi, I am trying to install APC

My server runs:

Directadmin 1.40.3
PHP 5.3.10
Apache 2.2.22

And everytime I try I get this:

Code:
[root@host modules]# pecl install apc
downloading APC-3.1.9.tgz ...
Starting to download APC-3.1.9.tgz (155,540 bytes)
.................................done: 155,540 bytes
54 source files, building
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
shtool at '/tmp/pear/temp/APC/build/shtool' does not exist or is not executable.
Make sure that the file exists and is executable and then rerun this script.

ERROR: `phpize' failed
[root@host modules]#


Can you please help me?
 
@SeLLeRoNe

Here it is:

Code:
[root@host /]# mount
/dev/hdv1 on / type ufs (defaults)
none on /proc type proc (defaults)
none on /dev/pts type devpts (gid=5,mode=620)
/vservers/morenado/tmp on /tmp type ufs (bind,noexec)
/vservers/morenado/var/tmp on /var/tmp type ufs (bind,noexec)
 
You need to remove the 'noexec' from /tmp
/vservers/morenado/tmp on /tmp type ufs (bind,noexec)

Once removed, remount /tmp and do the install, than you can re-enable it (more secure).

Maybe there is a way for use a different temp location, but actually i dont know, you should check on google for that.

Regards
 
Error:


Code:
 echo "extension=apc.so" > /etc/php.d/apc.ini
-bash: /etc/php.d/apc.ini: No such file or directory



How to fix?
 
I get this:


Code:
apc

APC Support	enabled
Version	3.1.9
APC Debugging	Disabled
MMAP Support	Enabled
MMAP File Mask	no value
Locking type	pthread mutex Locks
Serialization Support	php
Revision	$Revision: 308812 $
Build Date	May 4 2012 03:17:25

Directive	Local Value	Master Value
apc.cache_by_default	On	On
apc.canonicalize	On	On
apc.coredump_unmap	Off	Off
apc.enable_cli	Off	Off
apc.enabled	On	On
apc.file_md5	Off	Off
apc.file_update_protection	2	2
apc.filters	no value	no value
apc.gc_ttl	3600	3600
apc.include_once_override	Off	Off
apc.lazy_classes	Off	Off
apc.lazy_functions	Off	Off
apc.max_file_size	1M	1M
apc.mmap_file_mask	no value	no value
apc.num_files_hint	1000	1000
apc.preload_path	no value	no value
apc.report_autofilter	Off	Off
apc.rfc1867	Off	Off
apc.rfc1867_freq	0	0
apc.rfc1867_name	APC_UPLOAD_PROGRESS	APC_UPLOAD_PROGRESS
apc.rfc1867_prefix	upload_	upload_
apc.rfc1867_ttl	3600	3600
apc.serializer	default	default
apc.shm_segments	1	1
apc.shm_size	32M	32M
apc.slam_defense	On	On
apc.stat	On	On
apc.stat_ctime	Off	Off
apc.ttl	0	0
apc.use_request_time	On	On
apc.user_entries_hint	4096	4096
apc.user_ttl	0	0
apc.write_lock	On	On

What else should I do?
 
It's installed and running there. So it's up to you to understand how satisfied you are with that.
 
I guess it's some kind of a bug, as I've got APC 3.1.10 installed on one of servers, but it's shown as 3.1.9 by apc.php. Check it's version in phpinfo() output.

PHP:
<?php
phpinfo();
?>
 
@dmacleo,

Thanks for the link. It's said there it's fixed. I hope so, because I have not installed APC since the time of that post of mine.
 
the patch is released but I do not know how to install that.
but a fresh install (well 7 or so days old now) of php 5.3.14 and apc 3.1.10 still reports that way.
is "patching it" just a matter of editing php_apc.h and fixing the #?
I think so but had not had chance to see how to apply php patches like so.
 
Back
Top