# How to enable MMAP for PHP-APC



## psyc (May 8, 2013)

I have PHP-FPM set up with Nginx where I use APC for opcode cache and memcache for user cache.

I have a few issues using APC like it is storing user cache in form of a JavaScript file; at first I wasn't sure how it is using user cache, but later I came to know that it's the issue with shared memory. I have MMAP enabled for APC in Linux which stops APC from caching user variables, but MMAP for APC is disabled in my FreeBSD box, so, this might be the place I have to dig in.

I tried to install APC with `pecl install apc` but there was a bug, so, I used ports from /usr/ports/www/pecl-APC to install APC, which didn't ask me any options and installed APC without much tussle, but it doesn't have MMAP support installed by default. So, what do I have to do to enable MMAP support for APC now? 

As of Linux it compiles directly with MMAP in APC while doing `pecl install apc`, I tried the same thing in a Virtualbox FreeBSD guest, it is the same as on my main server, no MMAP while installing APC from ports.


----------



## Savagedlight (May 13, 2013)

`# cd /usr/ports/www/pecl-APC && make config`

This reveals that you can compile with IPC shm memory, while MMAP is the default. Verify that you've selected the right options.


----------



## psyc (May 13, 2013)

Savagedlight said:
			
		

> `# cd /usr/ports/www/pecl-APC && make config`
> 
> This reveals that you can compile with IPC shm memory, while MMAP is the default. Verify that you've selected the right options.



Thanks for the input, but which is the right option? 

I checked IPC once and unchecked IPC another time, and did a server reload/restart but still phpinfo says that MMAP support is disabled.


----------

