PHP APC apc_shm_create error on CLI
by Harun Yayli on Tuesday, March 11th, 2008 at 8:36 am under Hacks, PHP, Programming
If you’re getting an error like this one below on Windows PHP commandline make sure that you are not running an apache server that uses apc on the same machine!
[apc-error] apc_shm_create: shmget(0, 8388608, 658) failed: No error. It is possible that the chosen SHM segment size is higher than the operation system allows. Linux has usually a default limit of 32MB per segment.
This was hard to figure! Tested with PHP 5.2.5, APC 3.1.0-dev.
Recent Entries
- PHP Gurus in Montreal – I’m looking for 3 of them!
- Looking for 2 PHP Developers in Montreal (Senior and Intermediate)
- The difference between a bug and a feature
- Designing for Social Traction
- How to make Facebook shared links appear nice
- new pecl/memcache is out with memcache.php
- memcache.php flushes servers
- memcache.php can delete keys now
- memcache.php is now part of pecl/memcache
- memcache.php goes PECL
Just got the same issue! Thanks for the tip!
April 2nd, 2008 at 11:54 amHi,
I got the same error, and I also was able to make my script run on my Windows machine AFTER I turned Apache off. However, this doesn’t really seem like a viable solution.
If I have my website running on a machine, and then have a separate PHP process that I want to run on the same box…..this won’t work for me.
Is there not a way to configure the php.ini memory parameters, or Apache, so that both things can run in one place?
Thanks, and hopefully, you already have the answer to this.
December 20th, 2008 at 4:10 pmtry increasing the apc.shm_size on php.ini
July 5th, 2010 at 7:09 amincreasing the apc.shm_size solves temporarily the issue but shuts down apache (happens with xampp)
try commenting out the apc vars other than the apc.shm_segments
[apc]
September 8th, 2010 at 10:26 amapc.shm_segments = 1
;apc.shm_size = 512M
;apc.ttl = 7200
;apc.user_ttl = 7200
;apc.num_files_hint = 1024
;apc.enable_cli = 1