# APC does not cache



## rmir (Aug 13, 2013)

Hello. I have FreeBSD-8.2 in VDS. Apache 2.2.25, php-5.3.27 and pecl-apc 3.1.14_1. But apc.php display always 

```
Cached Files	1 (452.6 KBytes)
Hits	1
Misses	1
Request Rate (hits, misses)	2.00 cache requests/second
Hit Rate	1.00 cache requests/second
Miss Rate	1.00 cache requests/second
Insert Rate	1.00 cache requests/second
Cache full count	0
```
Any changes in php.ini with regards to APC, don't changing in apc.php or `php -i`. Debug mode shows nothing in the log of Apache. 

The APC configuration: 

```
apc.enabled=1
apc.shm_segments=1
apc.shm_size=32M
apc.ttl=0
apc.user_ttl=0
apc.num_files_hint=1024
apc.mmap_file_mask="/var/tmp/apc.XXXXXX"
apc.enable_cli=1
apc.max_file_size=2M
```
I have no idea what the problem is. 

Thank you.


----------



## SirDice (Aug 13, 2013)

rmir said:
			
		

> I have FreeBSD-8.2 in VDS.



Please upgrade to at least 8.4. FreeBSD 8.2 has been end-of-life since July 2012.

[thread=40469]Topics about unsupported FreeBSD versions[/thread]


----------



## rmir (Aug 13, 2013)

Sorry. I'm unable to edit the message to correct it to the correct style. And I have no possibility to upgrade the server to 8.4 or a higher version, because the server cannot be stopped. Sorry for the language.


----------



## SirDice (Aug 13, 2013)

If the server is that important, all the more reason to keep it up to date. I'd also suggest setting up a backup server. Hardware tends to break, usually at the worst possible moment.


----------



## rmir (Aug 27, 2013)

Thanks. Thread can be closed.


----------



## xtaz (Aug 27, 2013)

APC is no longer developed, and its use isn't recommended any longer. You should investigate using Zend OpCache instead. You can find this in the www/pecl-zendopcache port. It pretty much does exactly the same job. APC won't even compile against newer PHP versions.


----------



## rmir (Aug 28, 2013)

@xtaz: the only useful response. *T*hank you!


----------



## xtaz (Aug 28, 2013)

_I/You s_hould note that the php.ini options are different though. If you are using the latest version of PHP then you'll see all the options in the example file which start with opcache. They are mostly similar to the old APC options so quite easy to work out. I personally use this:


```
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.save_comments=0
opcache.fast_shutdown=1
opcache.enable_file_override=1
```

Also if you want an equivalent to the apc.php you mentioned, I use this: https://github.com/rlerdorf/opcache-status. The developer calls it "rather ugly" in the README, but I think that was an old version. It works well.

However, thanks for saying my reply was useful. But what the others have told you is also useful. Running old versions of things just because you don't want to restart or reboot things is bad practice. It's much more likely to get hacked or have unforeseen problems, and the older it gets, the less likely anybody is going to give you any support for it because other people run much newer things and what they say might not apply to what you run, or even your problem may have been fixed already.


----------

