Search code examples
phpwindowsapacheapc

Pages timeout after enabling APC


I have installed APC on our Windows dev server. After I enable APC and restart apache our pages do not load. They timeout and I just get connection was reset on browser. Other scripts on server such as phpmyadmin also does not load.

Here is our system config:

Windows 2003 Server
Apache 2.2.22
PHP Version 5.3.15
APC Version 3.1.11

Checking on apc.php I see hits 80% and misses 20%.

APC Runtime Settings

apc.cache_by_default    1
apc.canonicalize    1
apc.coredump_unmap    0
apc.enable_cli    0
apc.enabled    1
apc.file_md    50
apc.file_update_protection    2
apc.filters    ''
apc.gc_ttl    3600
apc.include_once_override    0
apc.lazy_classes    0
apc.lazy_functions    0
apc.max_file_size    1M
apc.num_files_hint    1000
apc.preload_path    ''
apc.report_autofilter    0
apc.rfc1867    0
apc.rfc1867_freq    0
apc.rfc1867_name    APC_UPLOAD_PROGRESS
apc.rfc1867_prefix    upload_
apc.rfc1867_ttl    3600
apc.serializer    default
apc.shm_segments    1
apc.shm_size    32M
apc.slam_defense    1
apc.stat    1
apc.stat_ctime    0
apc.ttl    0
apc.use_request_time    1
apc.user_entries_hint    4096
apc.user_ttl    0
apc.write_lock    1

I have seen files created on designated temp folder with names such as .apc.a00532 but they have file size 0

I also checked php error log and I do not see anything there.

Any help is greatly appreciated, thanks in advance.

Edit I am using VC9 compiled PHP and my apache is matching VC9 compiled from apache lounge. I have tried using APC 3.1.9 also and that does not display page also. Any php script I run gives timeout except apc.php itself and there it shows me things are being cached.


Solution

  • Maybe the APC version you're using is not matching your PHP version.
    The first thing I should do is to run php -v from the command line and check for errors.
    Be aware that the APC 3.1.11 version is still beta; the latest stable version is 3.1.9.
    You can download the APC precompiled binary version from here.
    To choose the right APC version (VC6/VC9 - thread-safe/non-thread-safe), you should disable APC and open a "phpinfo()" page, then look for the options "Thread safety" and "Configure command".
    If you have downloaded your PHP from the PHP site, the 5.3.15 version should be VC9 compiled.
    This version should not be used with "apache.org" binaries, as you can read here, so you should also use the Apache VC9 version, available from Apache Lounge.