mod_fcgid cannot allocate memory

Hi!

Code:
[emerg] (12)Cannot allocate memory: mod_fcgid: Can't create shared memory for size 1192488 bytes

This was a problem I stumbled upon today and didn't find a solution for it on the forums but finally figured it out using debug in apache and switching place on the fcgid and php module, so here's the solution for it.

This solution is only if you also have the mod_php module loaded and have eaccelerator installed for php.

The thing that makes this error to be thrown is that you're probably loading mod_php before the fcgid module in the first place, throwing you a bit in the wrong direction as it's a problem with php and not fcgid.

What you want to do is deinstall eaccelerator, edit the Makefile for eaccelerator and add --with-eaccelerator-shared-memory=yes to the configure_args, something like this:
Code:
CONFIGURE_ARGS= --enable-eaccelerator=shared \
                --with-eaccelerator-userid=80 \
                --without-eaccelerator-use-inode \
                --with-eaccelerator-shared-memory=yes

Recompile and restart apache and it should be working just fine.
 
Sorry for posting on an older thread, but in my case I don't even have mod_php or eaccelerator, in fact I used a package to install apache22 and ap22-mod_fcgid and php5, yet I'm getting following error:

Code:
[Thu Feb 23 02:51:24 2012] [emerg] (78)Function not implemented: mod_fcgid: Can't create shared memory for size 1192488 bytes

I can't figure out how to get rid of it, other then go away from mod_fcgid. Is there any other ideas what else I can try to get it to work?
 
Your package installation probably installed mod_php without you knowing it.

Easiest way do know if it is a PHP problem or not is to just comment PHP in your apache config (/usr/local/etc/apache22/httpd.conf) then restart apache and check if the error still occurs. If so, it is probably a php module throwing this error.

What you are looking for is something like this:
Code:
LoadModule php5_module        libexec/apache22/libphp5.so
 
Old thread but I ran into this issue today while attempting to start apache 2.2.22_5 in a FreeBSD 8.2 jail. This is basically the only page I could find about the error and the previous fixes did not work for me. The error was a result of shared memory being disabled for the jail per default. Enabling this through sysctl and restarting the jail worked.

# sysctl security.jail.sysvipc_allowed=1

Hope this helps anyone else that reaches this page from Google.
 
Back
Top