php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74321 APCu error with php 7.1.3 on Windows
Submitted: 2017-03-27 23:30 UTC Modified: 2017-04-19 16:16 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: lucas dot piris at mindworks dot com dot br Assigned:
Status: Not a bug Package: APC (PECL)
PHP Version: 7.1.3 OS: Windows Server 2008 R2 SP1
Private report: No CVE-ID: None
 [2017-03-27 23:30 UTC] lucas dot piris at mindworks dot com dot br
Description:
------------
My php.ini settings:


[APCu]
apc.enabled=1
apc.shm_segments=1
apc.shm_size=128M
apc.ttl=7200
apc.enable_cli=1
apc.serializer=php

The apache service unable to start when apc.enabled=1, causing error:

[27-Mar-2017 23:09:03 UTC] PHP Fatal error:  PHP Startup: apc_shm_attach: shmat failed: in Unknown on line 0


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-03-29 10:55 UTC] cmb@php.net
-Package: *General Issues +Package: APC
 [2017-03-29 10:55 UTC] cmb@php.net
Reclassifying to package APC, as APCu is not yet available.
 [2017-03-29 13:29 UTC] lucas dot piris at mindworks dot com dot br
Hi,

The problem is on Windows Server 2008 R2 SP1 with M, on:

[APCu]
apc.shm_size=32M

Without M,

This works.
 [2017-03-29 16:05 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2017-03-29 16:05 UTC] ab@php.net
Thanks for the report. I've tried the current APCu master but it doesn't seem to reproduce the fatal error. Is there anything else involved, that might matter?

Thanks.
 [2017-03-29 16:09 UTC] lucas dot piris at mindworks dot com dot br
-Status: Feedback +Status: Open
 [2017-03-29 16:09 UTC] lucas dot piris at mindworks dot com dot br
I honestly do not know what else might be involved, I ran a test in my Windows Server 2016 environment, and it worked without any problems.

Is there a way to debug the module?
 [2017-03-29 16:30 UTC] ab@php.net
Ofc, you could debug with Visual Studio or any other debugger. You can run Apache without daemonizing it from within debugger, or attach to the process. If you go this way, don't hesitate to ask for hints. Otherwise, possible steps could be also

- exclude any shared extension but APCu
- check an earlier version
- play with ini
- possibly some PHP code affects it
- some other program/process could affect behaviors, too

I was testing on win10, so that's same as yours last. Unfortunately i've no win7 machines i could debug on atm. But also, listing the history, it doesn't look like any of latest revs could affect these behaviors. I'd expect therefore, it were reproducable disregarding the OS version.

Thanks.
 [2017-03-30 13:26 UTC] ab@php.net
-Status: Open +Status: Not a bug
 [2017-03-30 13:26 UTC] ab@php.net
@lucas, got to your mail now. You seem to load the APCu version compiled for a different version of PHP. Please consider the module API warning. This is fixed by checking the environment and configs.

Thanks.
 [2017-04-19 15:52 UTC] gendalf-v at mail dot ru
Hello,
I have the same problem.
I tried add apc.shm_size, but it does not help.
Also I tried use APCu 5.1.6 and APCu 5.1.8

php -v
PHP Fatal error:  PHP Startup: apc_shm_attach: shmat failed: in Unknown on line 0
Fatal error: PHP Startup: apc_shm_attach: shmat failed: in Unknown on line 0

My php.ini
[APCu]
apc.enabled=1
apc.enable_cli=1

My environment:
Windows 7 x64
php -v
PHP 7.1.4 (cli) (built: Apr 11 2017 19:54:37) ( ZTS MSVC14 (Visual C++ 2015) x64 )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.4, Copyright (c) 1999-2017, by Zend Technologies
 [2017-04-19 16:00 UTC] lucas dot piris at mindworks dot com dot br
Try this:

apc.shm_size=32

Without "M".

Regards
Lucas
 [2017-04-19 16:13 UTC] gendalf-v at mail dot ru
Hi Lucas,

If I use "apc.shm_size=32" (without M) I have warning

php -v
PHP Warning:  PHP Startup: apc.shm_size now uses M/G suffixes, please update your ini files in Unknown on line 0

Warning: PHP Startup: apc.shm_size now uses M/G suffixes, please update your ini files in Unknown on line 0
PHP 7.1.4 (cli) (built: Apr 11 2017 19:54:37) ( ZTS MSVC14 (Visual C++ 2015) x64 )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.4, Copyright (c) 1999-2017, by Zend Technologies
 [2017-04-19 16:16 UTC] lucas dot piris at mindworks dot com dot br
Hi Gendalf,

Yes, I know, but this works for me using apache as service.

Regards
Lucas
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC