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

4 Responses to “PHP APC apc_shm_create error on CLI”

  1. PHP Encoder Says:

    Just got the same issue! Thanks for the tip!

  2. JamesD Says:

    Hi,
    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.

  3. Dimitris Baltas Says:

    try increasing the apc.shm_size on php.ini

  4. Dimitris Baltas Says:

    increasing 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]
    apc.shm_segments = 1
    ;apc.shm_size = 512M
    ;apc.ttl = 7200
    ;apc.user_ttl = 7200
    ;apc.num_files_hint = 1024
    ;apc.enable_cli = 1

Leave a Reply

authimage