My VPS server has Centos 5 box running PHP 5.2.17 with a dso handler, as well as Apache 2.2.21.
I attempted to install the APC PHP accelerator v3.1.9 on the server, but it left my site unaccessible.
From the command prompt, typed pecl install apc; this did the installation of APC and configured my php.ini file with various APC settings.
These are the settings that I ended up using:
[APC]
extension="apc.so"
apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 2M
apc.optimization = 0
apc.num_files_hint = 512
apc.user_entries_hint = 1024
apc.ttl = 60
apc.user_ttl = 0
apc.gc_ttl = 600
apc.cache_by_default = 1
apc.filters = "apc\.php$"
apc.slam_defense = 0
apc.use_request_time = 1
apc.mmap_file_mask = /tmp/apcfm.XXXXX
;OR apc.mmap_file_mask = /dev/zero
apc.file_update_protection = 2
apc.enable_cli = 0
apc.max_file_size = 2M
apc.stat = 1
apc.write_lock = 1
apc.report_autofilter = 0
apc.include_once_override = 0
apc.rfc1867 = 0
apc.rfc1867_prefix = "upload_"
apc.rfc1867_name = "APC_UPLOAD_PROGRESS"
apc.rfc1867_freq = 0
apc.localcache = 1
apc.localcache.size = 512
apc.coredump_unmap = 0
apc.stat_ctime = 1
Unfortunately, after I restarted apache after making this change, I found that I was unable to access my site.
When I attempted to restart apache to fix the issue, I got the following error:
httpd not running, trying to start
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
I figured that apache must have hung in some horrible way, so I used top to get the process id and kill -9 pid to kill it. I was able to restart apache, but I found that I still could not access my site.
I was able to get things working by commenting out these lines and disabling apc:
extension="apc.so"
apc.enabled = 1
So it looks like it was the APC installation that caused the Apache process to hang.
My questions are:
1. Why did the APC installation cause this?
2. What my I have done wrong or missed in my installation that could have caused this?
Please let me know if there's any more information I can provide to help to resolve this.