2

Any ideas on how i can fix this warning?

Getting this while executing it from shell, on FreeBSD 8.x

# /usr/local/bin/php --run 'echo "test";'
  PHP Warning:  PHP Startup: apc.shm_segments setting ignored in MMAP mode 
  in Unknown on line 0
  test
  Segmentation fault: 11

Happy new year !

Phliplip
  • 531
  • 8
  • 21

2 Answers2

4

When APC is configured with mmap it only uses 1 shm_segment. To remove the warning either comment out or delete the apc.shm_segments line in your .ini file.

Chris_O
  • 737
  • 4
  • 15
  • Great, i actually had some apc settings tucked away in extensions.ini - Found it after hours of trial and error, setting apc.shm_segments in php.ini didn't change anything, but some other settings did. So i was pretty confused :) The error message is now gone.. but the seg. fault still persist.. any ideas on how to go around this? – Phliplip Jan 07 '11 at 12:18
  • I found the segfault problem, it was caused by the yaz module. Commented it out from my extensions.ini :) – Phliplip Jan 07 '11 at 14:08
  • What do you have your apc.shm_size set at? Just curious. – Chris_O Jan 08 '11 at 06:02
2

I had the same problem. Running any command throws this error message

PHP Warning:  PHP Startup: apc.shm_segments setting ignored in MMAP mode in Unknown on line 0

in my case the setting was in apc.ini under the path

/etc/php.d/apc.ini

I have updated the line

"apc.shm_segments=3" to "apc.shm_segments=1" 

and it solved the problem.

flyin23
  • 121
  • 1