APC not storing cache IIS and PHP 5.1.2

Hi all,

This seems to be the only place that I can find with a similar topics so I hope you can help.

I have installed APC on my Dev PC (Windows XP Pro - IIS 5) with the intention of installing on live server (windows server 2003 - IIS 6).

APC is installed now ok and running (PHPInfo output below) However if I use apc.php to view what has been cached it reports nothing except apc.php is cached, and apc.php is recached each time I access it... Basically its not storing the cached data.

I have checked my C:\WINDOWS\Temp\ folder and there are 3 files..

apc.lock.0 (0 bytes)
apc.lock.1 (0 bytes)
apc.lock.2 (0 bytes)

What am I doing wrong?

Thanks in advance

PHPInfo Output:

APC Support enabled
Version 3.0.11-dev
MMAP Support Disabled
Revision $Revision: 3.90 $
Build Date May 4 2006 00:20:07

Directive Local Value Master Value
apc.cache_by_default On On
apc.enable_cli On On
apc.enabled On On
apc.file_update_protection 2 2
apc.filters no value no value
apc.gc_ttl 3600 3600
apc.max_file_size 1M 1M
apc.num_files_hint 1000 1000
apc.optimization Off Off
apc.shm_segments 1 1
apc.shm_size 128 128
apc.slam_defense Off Off
apc.stat On On
apc.ttl 3600 3600
apc.user_entries_hint 100 100
apc.user_ttl 3600 3600

questions about the main steps

Hi Tim,

Not sure what the problem is, so here are some questions about the main steps. Maybe someone with specific knowledge here could jump in.

1) I assume you have PHP working just fine?

2) You have PHP working using the DLL not the EXE (php.exe) ?

3) You are loading the APC extension in your php.ini ?
For details see: APC install

4) You are using the appropriate version of APC for your version of PHP ?
The official versions of APC are:
1 php_apc.dll php-4.3.11 (4_3) 100 498 Compile 2006-05-04 16:05:00
2 php_apc.dll php-4.4.0 (4_4) 96 411 Compile 2005-10-10 21:10:25
3 php_apc.dll php-4.4.1 (4_4) 100 348 Compile 2006-05-04 16:05:04
4 php_apc.dll php-5.1.0 (5_1) 56 585 Compile 2005-11-08 15:11:47
5 php_apc.dll php-5.1.1 (5_1) 56 511 Compile 2006-01-23 11:01:24
6 php_apc.dll php-5.1.2 (5_1) 60 1,203 Compile 2006-05-03 22:05:20 <---(you should be using this one)

5) You are using the correct version of apc.php ?


If you are using PHP with the php.exe try using the the DLL method within IIS.

1) yes 2) using php.exe but

1) yes
2) using php.exe but just tried the dll (see below)
3) yes
4) yes
5) yes

When I use the dll APC disables it self even though i have enable = 1 in the ini file

phpinfo output with dll:

APC Support disabled
Version 3.0.11-dev
MMAP Support Disabled
Revision $Revision: 3.90 $
Build Date May 4 2006 00:20:07

Also as I understand it, the DLL is less stable than the exe ?

Thanks for the help

Tim, I think the instable


I think the instable reputation of PHP with the DLL is an "old thing". I've been using PHP with DLL and IIS since years with no particular issue. I do remember the warning about the DLL dating years back. In fact my most stable configuration has been IIS 5, PHP 4 with eAccelerator 0.9.3 (zero crash).

DLL is a lot faster. With the .exe you end up loading the full "PHP env" with each request...

Potential issues:

1)  apc.shm_size 128
That value seems a little high try something like 24 to start.

On this server (the one running sitebuddy) a dual Xeon with 2GB Ram, the control panel behaves strangely if I try to pass the 64.

2) apc.enable_cli

Disable this for your testing with the DLL.

3) Check you permissions using FileMon:
How to use FileMon under Windows