php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56764 [apc-error] apc_shm_create: shmget(0, 33554432,658) failed: No error.
Submitted: 2006-01-04 06:21 UTC Modified: 2006-05-13 09:50 UTC
From: super2003 at ukr dot net Assigned:
Status: Closed Package: APC (PECL)
PHP Version: 4.4.1 OS: Windows 2003
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: super2003 at ukr dot net
New email:
PHP Version: OS:

 

 [2006-01-04 06:21 UTC] super2003 at ukr dot net
Description:
------------
I am using IIS with PHP 4.4.1 and APC and had error:

[Wed Jan 04 13:18:58 2006] [apc-error] apc_shm_create: shmget(0, 33554432,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.

Reproduce code:
---------------
[Apc]
extension=php_apc.dll
apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 32
apc.optimization = 0
apc.ttl = 0
apc.cache_by_default = On
apc.slam_defense=0


Expected result:
----------------
[Wed Jan 04 13:18:58 2006] [apc-error] apc_shm_create: shmget(0, 33554432,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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-23 14:34 UTC] ramsey@php.net
I'm getting a similar error, and I'm running Apache 1.3.33 with PHP 4.4.2 on Mac OS X 10.4.4 (the Apache and PHP installs where compiled from source, not from Fink or elsewhere). The version of APC I compiled is 3.0.8.

When I try to restart Apache after adding "extension=apc.so" to php.ini, I get the following:

ramsey:~ ramsey$ sudo apachectl graceful
apachectl graceful: configuration broken, ignoring restart
apachectl graceful: (run 'apachectl configtest' for details)
ramsey:~ ramsey$ apachectl configtest
[Mon Jan 23 14:24:09 2006] [apc-error] apc_shm_create: shmget(0, 31457280,914) failed: Invalid argument. 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.
 [2006-01-23 14:57 UTC] rasmus@php.net
Use mmap instead: --enable-apc-mmap
 [2006-03-19 14:38 UTC] rocketjock at onlicom dot net
Thank You Rasmus....worked great!!!
 [2006-04-08 04:15 UTC] shawn at digitalpoint dot com
Regarding the error on OS X, it's an easy fix (although 
annoying that it requires a reboot of the computer to apply 
the kernel change):

http://www.digitalpoint.com/~shawn/2006/03/installing-apc-on-
bsd-variants.html
 [2006-05-13 09:50 UTC] gopalv82 at yahoo dot com
The linked blog entry (inline here for future reference): 

> Most BSD variants (including Mac OS X Server in my case)
> don't allow much shared memory to be allocated by default.
> Lucky, it's an easy fix...
>
> My OS had a default allowance of 4MB max for shared 
> memory. You can alter that by adding this to your 
> /etc/sysctl.conf file (or creating it if it doesn't 
> exist):
>
>  My new /etc/sysctl.conf file...
>
>    kern.sysv.shmmax=134217728
>    kern.sysv.shmmin=1
>    kern.sysv.shmmni=32
>    kern.sysv.shmseg=8
>    kern.sysv.shmall=32768
>
> shmall should be shmmax/4096
>
> So the above config will let you use up to 128MB for 
> shared memory.
>
> You can't dynamically set the shared memory kernel 
> variables with the sysctl command because once it's set, 
> it can't be altered. Because of that, you must reboot your
> server after you edit the sysctl.conf file...
>
> ... that *only* editing sysctl.conf works on Mac OS X.
> For Mac OS X Server, you need to comment out the 
> kern.sysv.shm* lines in /etc/rc (in Mac OS X Server those 
> commands are called before sysctl.conf is read for some 
> reason).
 [2008-12-20 15:34 UTC] demichej at hotmail dot com
This all seems to be pertinent for non-Windows users, yet the bug was opened for the Windows OS. 

Does anyone have a solution for Windows?

I am using 

APC 3.0.9
Windows XP
Apache 2.2

If I turn Apache off, and run a PHP script, things work great, but I can't seem to have the Apache server running, while running a PHP script with APC enabled.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 24 16:01:32 2024 UTC