php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58453 in CLI mode APC cache is not working in windows
Submitted: 2008-12-10 06:50 UTC Modified: 2016-08-31 15:07 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: pradeep dot gems at gmail dot com Assigned: cmb (profile)
Status: Wont fix Package: APC (PECL)
PHP Version: 5.2.5 OS: Windows
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: pradeep dot gems at gmail dot com
New email:
PHP Version: OS:

 

 [2008-12-10 06:50 UTC] pradeep dot gems at gmail dot com
Description:
------------
While I run APC Cache in WAMP environment, I tried to execute a PHP page in command line but its throwing the following error :

[apc-error] apc_shm_create: shmget(0,
31457280,658) failed: No such file or directory. It is possible that the
chosen
egment size is higher than the operation system allows. Linux has
usually a default limit of 32MB per segment.

Event if I simply type php.exe then enter it gives the error. No idea where the problem, I went through some of the Rasmus comments says "Enable MMAP" but in windows its already precompiled state DLL, so can you suggest me how to fix this problem?

Reproduce code:
---------------
c:\wamp\bin\php\php test.php

Actual result:
--------------
[apc-error] apc_shm_create: shmget(0,
31457280,658) failed: No such file or directory. It is possible that the
chosen
egment 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
 [2008-12-20 15:27 UTC] demichej at hotmail dot com
I am also experiencing a similar issue. It appears from a separate blog post I found that if you have Apache running on the same machine, and attempt to run a PHP script with APC enabled, then you will receive this error.

If I then turn off Apache (2.2 in my case), on Windows XP, then run the PHP script, everything works fine.

However, this doesn't really seem viable. What if I want to run a server on a machine, and also have PHP script running on that same box.......I will get this error.

Is anyone looking into this, or do they have a solution?

Thanks.
 [2009-10-07 16:35 UTC] kalle@php.net
What is your php.ini settings for apc?
 [2009-10-10 10:11 UTC] kukulich at kukulich dot cz
I got same error with this APC settings:

[apc]
extension=php_apc.dll
apc.enabled = On
apc.enable_cli = On

WinXP, Apache 2.2 VC9, PHP 5.3.1 RC 1 VC9, APC 3.1.3p1
(I got same error with 5.2 VC6 and older version of APC)
 [2009-10-12 01:35 UTC] pradeep dot gems at gmail dot com
apc]
extension=php_apc.dll
apc.enabled = On
apc.enable_cli = On
 [2009-12-09 15:22 UTC] spoon at nexdot dot net
Same problem here.

Server 2003, Apache 2.2.14 VC9, PHP 5.3.1 VC9 (both TS and 
NTS), APC 3.1 VC9 (both TS and NTS) from 
http://downloads.php.net/pierre/ (dated: 20091026)

When running PHP as a module in apache, web pages come up 
blank, if I run php.exe (while apache is still running) I receive 

[apc-error] apc_shm_create: shmget(0,
31457280,658) failed: No such file or directory. It is 
possible that
the
chosen
egment size is higher than the operation system allows. 
Linux has
usually a default limit of 32MB per segment.


If i stop apache, I can successfully run php.exe.... but 
that doesnt help me too much :)
 [2009-12-12 22:51 UTC] shire@php.net
Can you verify that your system is not running low on/ or out of memory?  Perhaps this could be a failure due to the system being unable to allocate memory for the shared memory segment.
 [2009-12-16 10:17 UTC] spoon at nexdot dot net
System has 1.3GB of physical ram not in use. Ive tried 
everything from setting the shm size to 1M to forcing 
apache/php to run as admin w/ full rights. Its quite awkward.

It appears that APC is running just fine when I load php using  
fcgi - load tests & phpinfo() confirm its loaded.

Only fails when loading php as a module or when trying to run 
cli when fcgi is running (im assuming this is because of a 
sharing violation of some sort?)
 [2011-11-15 10:37 UTC] clepsos2003 at hotmail dot com
Same problem on Wamp (PHP 5.3.7 - Apache 2.2.11)

Here is the command line code :
php -d apc.enable_cli=1 -r "apc_clear_cache();"
 [2013-07-03 04:22 UTC] rudylee1988 at gmail dot com
I had the same problem with WAMP 2.0 running on Windows. It turns out that php.exe 
under WAMP folder is loading different php.ini file. 

You have to run "php -i | more" to find the location of the php.ini file ( loaded 
configuration file ). After that you have to enable the apc manually by adding 
extension=php_apc.dll and the apc settings ( read the comments above ).

I hope that helps...
 [2016-08-31 15:07 UTC] cmb@php.net
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2016-08-31 15:07 UTC] cmb@php.net
According to <https://bugs.php.net/69618>, APC support has been
discontinued in favor of OPcache, APCu, the session upload
progress API and WinCache. Therefore this issue won't get fixed.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Oct 30 16:01:23 2020 UTC