Search code examples
phpmacosapache2macportsfastcgi

Installing PHP FCGI and Apache with worker mpm on Mac OSX using macport


I am installing a server for PHP using FCGI and apache with worker MPM here is what I have done so far:

sudo port install apache2 +workermpm
sudo port install php5 +fastcgi
sudo port install mod_fcgid

when I tried to load apache2 with

sudo port load apache2

changes on httpd.conf settings:

LoadModule fcgid_module modules/mod_fcgid.so

<IfModule mod_fcgid.c>
        AddHandler fcgid-script .php
        DefaultMaxClassProcessCount 4
        DefaultInitEnv PHP_FCGI_MAX_REQUESTS 0
        DefaultInitEnv PHP_FCGI_CHILDREN 0
        FCGIWrapper /opt/local/bin/php-cgi .php
        <Files *.php>
                Options +ExecCGI
        </Files>
       SharememPath /opt/local/apache2/fcgid/shm
</IfModule>

I got this error on /opt/local/apache2/logs/error_log

[Mon Sep 05 09:54:00 2011] [emerg] (17)File exists: mod_fcgid: Can't create shared memory for size 682600 bytes

Anybody has encountered this problem? please tell me how to solve this.

Thank You


Solution

  • I just solved this particular problem. Currently the Macport of mod_fcid has the problem, that it seems to need the directory /opt/local/apache2/var/run/ for starting up with mod_fcgid enabled. It seems not to recognize the SharedmemPath-setting or other configuration switches.

    Just create this directory and the apache starts up.