<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: FreeBSD Configure Apache 2.2 PHP with FastCGI mod_fcgi Module</title> <atom:link href="http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/feed/" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/</link> <description>Every answer asks a more beautiful question.</description> <lastBuildDate>Fri, 10 Feb 2012 19:55:56 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Aeomer</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-64307</link> <dc:creator>Aeomer</dc:creator> <pubDate>Thu, 10 Nov 2011 14:20:02 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-64307</guid> <description>This is an oldish thread, but I had to comment on some &#039;Whys?&quot; rather than the list of &quot;Hows?&quot;.
It is a common myth that mod_php is slower - it is faster in real world applications, but *only just* compared to fcgid. fgcid + eAccelerator is demonstrably fractionally slower than mod_php + eAccelerator. So why not just use mod_php? The answer is two fold.
1. There are more security options using fcgid. This is only relevant when you have untrusted user scripts such as found in hosting environments.
2. You can use worker-mpm on Apache. Let&#039;s face it, Apache is still in the Stone-Age when it comes to threading. Worker-mpm improves resource utilization on high traffic sites significantly, but mod_php in such a configuration is not guaranteed. The reason is not mod_php (which is thread-safe) but all the various extensions you may use with it (which are often not thread-safe). By using mod_fcgid you can use threaded apache and not worry about php extension thread-safety.
In the real-world I use both mod_php and fcgid depending on my requirements. mod_php for my mercurial server that is heavily fortified and has a limited user base, and mod_fcgid for load balanced high-performance sites, 80,000 or more hits per minute, where the pre-fork model is just not tenable.
YMMV
Real Story: A existing website with a following of more than 130,000 registered users and an awful lot of lurkers was re-engineered to not only look more modern but also link into a vast number of business processes. The site went live, and every one of the user base hit it in the first five minutes after launch. Despite the number of servers and virtual servers in the cluster the pre-fork model simply could not cope. Switching to worker-mpm handled the load easily, but some of the apache instances crashed randomly. Changing to use fcgid rather than mod_php sorted the crashing issue. I never did get an an answer as to which php optional extension (we used a lot of them) caused the issue. Now there&#039;s a task for someone with time on their hands! :-)</description> <content:encoded><![CDATA[<p>This is an oldish thread, but I had to comment on some &#8216;Whys?&#8221; rather than the list of &#8220;Hows?&#8221;.</p><p>It is a common myth that mod_php is slower &#8211; it is faster in real world applications, but *only just* compared to fcgid. fgcid + eAccelerator is demonstrably fractionally slower than mod_php + eAccelerator. So why not just use mod_php? The answer is two fold.</p><p>1. There are more security options using fcgid. This is only relevant when you have untrusted user scripts such as found in hosting environments.<br
/> 2. You can use worker-mpm on Apache. Let&#8217;s face it, Apache is still in the Stone-Age when it comes to threading. Worker-mpm improves resource utilization on high traffic sites significantly, but mod_php in such a configuration is not guaranteed. The reason is not mod_php (which is thread-safe) but all the various extensions you may use with it (which are often not thread-safe). By using mod_fcgid you can use threaded apache and not worry about php extension thread-safety.</p><p>In the real-world I use both mod_php and fcgid depending on my requirements. mod_php for my mercurial server that is heavily fortified and has a limited user base, and mod_fcgid for load balanced high-performance sites, 80,000 or more hits per minute, where the pre-fork model is just not tenable.<br
/> YMMV</p><p>Real Story: A existing website with a following of more than 130,000 registered users and an awful lot of lurkers was re-engineered to not only look more modern but also link into a vast number of business processes. The site went live, and every one of the user base hit it in the first five minutes after launch. Despite the number of servers and virtual servers in the cluster the pre-fork model simply could not cope. Switching to worker-mpm handled the load easily, but some of the apache instances crashed randomly. Changing to use fcgid rather than mod_php sorted the crashing issue. I never did get an an answer as to which php optional extension (we used a lot of them) caused the issue. Now there&#8217;s a task for someone with time on their hands! :-)</p> ]]></content:encoded> </item> <item><title>By: nsamu</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-54439</link> <dc:creator>nsamu</dc:creator> <pubDate>Mon, 03 Jan 2011 18:56:13 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-54439</guid> <description>I receive the same error. I am running a FreeBSD jail created using ezjajil.</description> <content:encoded><![CDATA[<p>I receive the same error. I am running a FreeBSD jail created using ezjajil.</p> ]]></content:encoded> </item> <item><title>By: yudanta</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-50190</link> <dc:creator>yudanta</dc:creator> <pubDate>Tue, 19 Oct 2010 04:29:47 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-50190</guid> <description>i have the same probleme that found by SSJ, when i open index.php its ok, but if i open index.html i have 500 error. this is my dir_module on httpd.conf
DirectoryIndex index.html index.shtml index.cgi index.php
thanks before</description> <content:encoded><![CDATA[<p>i have the same probleme that found by SSJ, when i open index.php its ok, but if i open index.html i have 500 error. this is my dir_module on httpd.conf</p><p> DirectoryIndex index.html index.shtml index.cgi index.php</p><p>thanks before</p> ]]></content:encoded> </item> <item><title>By: SSJ</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-48144</link> <dc:creator>SSJ</dc:creator> <pubDate>Wed, 30 Jun 2010 10:28:24 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-48144</guid> <description>Hello,
thank you for this article. I have followed every step.
no errors at apache22 startup, but can&#039;t get working .html files, only php is working via fcig.
when I enter http://url/index.php is ok, when I enter http://url/index.html got 500 error. File permisions is ok 644 and owner is ok ( same as index.php )
where I&#039;m wrong?
Thank you</description> <content:encoded><![CDATA[<p>Hello,</p><p>thank you for this article. I have followed every step.</p><p>no errors at apache22 startup, but can&#8217;t get working .html files, only php is working via fcig.</p><p>when I enter <a
href="http://url/index.php" rel="nofollow">http://url/index.php</a> is ok, when I enter <a
href="http://url/index.html" rel="nofollow">http://url/index.html</a> got 500 error. File permisions is ok 644 and owner is ok ( same as index.php )</p><p>where I&#8217;m wrong?</p><p>Thank you</p> ]]></content:encoded> </item> <item><title>By: Vivek Gite</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-42958</link> <dc:creator>Vivek Gite</dc:creator> <pubDate>Sat, 08 Aug 2009 19:04:12 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-42958</guid> <description>@Fred,
Yes, I&#039;m running in FreeBSD jail without any problem. Are you talking about chroot(2) based jail or FreeBSD jail(8) or mod_chroot?</description> <content:encoded><![CDATA[<p>@Fred,</p><p>Yes, I&#8217;m running in FreeBSD jail without any problem. Are you talking about chroot(2) based jail or FreeBSD jail(8) or mod_chroot?</p> ]]></content:encoded> </item> <item><title>By: Fred</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-42957</link> <dc:creator>Fred</dc:creator> <pubDate>Sat, 08 Aug 2009 18:58:33 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-42957</guid> <description>Great post! Thanks!
Have you ever got this setup running in a jail? I&#039;m getting a &quot;not implemented&quot; error preventing apache from starting, but only in jailed environments.</description> <content:encoded><![CDATA[<p>Great post! Thanks!</p><p>Have you ever got this setup running in a jail? I&#8217;m getting a &#8220;not implemented&#8221; error preventing apache from starting, but only in jailed environments.</p> ]]></content:encoded> </item> <item><title>By: Anderson</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-42450</link> <dc:creator>Anderson</dc:creator> <pubDate>Fri, 10 Jul 2009 10:08:24 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-42450</guid> <description>Oh! i get it...
This right?
LoadModule fcgid_module libexec/apache22/mod_fcgid.so
and This wrong?
LoadModule fastcgi_module libexec/apache22/mod_fastcgi.so</description> <content:encoded><![CDATA[<p>Oh! i get it&#8230;</p><p>This right?<br
/> LoadModule fcgid_module libexec/apache22/mod_fcgid.so</p><p>and This wrong?<br
/> LoadModule fastcgi_module libexec/apache22/mod_fastcgi.so</p> ]]></content:encoded> </item> <item><title>By: Anderson</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-42449</link> <dc:creator>Anderson</dc:creator> <pubDate>Fri, 10 Jul 2009 09:54:56 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-42449</guid> <description>yes. I added in httpd.conf. look like this right?
.............................
LoadModule rewrite_module libexec/apache22/mod_rewrite.so
LoadModule fastcgi_module libexec/apache22/mod_fastcgi.so
#LoadModule php5_module        libexec/apache22/libphp5.so
...............................</description> <content:encoded><![CDATA[<p>yes. I added in httpd.conf. look like this right?</p><p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<br
/> LoadModule rewrite_module libexec/apache22/mod_rewrite.so<br
/> LoadModule fastcgi_module libexec/apache22/mod_fastcgi.so<br
/> #LoadModule php5_module        libexec/apache22/libphp5.so</p><p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</p> ]]></content:encoded> </item> <item><title>By: Vivek Gite</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-42448</link> <dc:creator>Vivek Gite</dc:creator> <pubDate>Fri, 10 Jul 2009 09:04:13 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-42448</guid> <description>Did you added the following to your config file?
&lt;pre&gt;LoadModule fcgid_module libexec/apache22/mod_fcgid.so&lt;/pre&gt;</description> <content:encoded><![CDATA[<p>Did you added the following to your config file?</p><pre>LoadModule fcgid_module libexec/apache22/mod_fcgid.so</pre>]]></content:encoded> </item> <item><title>By: Anderson</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-42447</link> <dc:creator>Anderson</dc:creator> <pubDate>Fri, 10 Jul 2009 08:43:19 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-42447</guid> <description>I have problem when i start apache
srv# apachectl start
Syntax error on line 187 of /usr/local/etc/apache22/httpd.conf:
Invalid command &#039;FCGIWrapper&#039;, perhaps misspelled or defined by a module not included in the server configuration
I running in FreeBSD 7.2 and Apache 2.2.11. How to fix it?
Thanks
Anderson</description> <content:encoded><![CDATA[<p>I have problem when i start apache</p><p>srv# apachectl start<br
/> Syntax error on line 187 of /usr/local/etc/apache22/httpd.conf:<br
/> Invalid command &#8216;FCGIWrapper&#8217;, perhaps misspelled or defined by a module not included in the server configuration</p><p>I running in FreeBSD 7.2 and Apache 2.2.11. How to fix it?</p><p>Thanks<br
/> Anderson</p> ]]></content:encoded> </item> <item><title>By: Borg</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-42015</link> <dc:creator>Borg</dc:creator> <pubDate>Thu, 11 Jun 2009 08:27:02 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-42015</guid> <description>I followed the directions exactly and this does not work properly. The only thing close I can get working properly is fcgid and when I disable the php5 module, virtual hosting goes for an absolute crapper. I also could not get the CGI/FastCGI to show up in phpinfo.php. I could however get fcgid to work.</description> <content:encoded><![CDATA[<p>I followed the directions exactly and this does not work properly. The only thing close I can get working properly is fcgid and when I disable the php5 module, virtual hosting goes for an absolute crapper. I also could not get the CGI/FastCGI to show up in phpinfo.php. I could however get fcgid to work.</p> ]]></content:encoded> </item> <item><title>By: Binit</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-40300</link> <dc:creator>Binit</dc:creator> <pubDate>Sat, 14 Feb 2009 22:54:06 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-40300</guid> <description>Thanks for posting this Vivek .... While I was able to get the fastCGI to work with PHP by following your instructions, it broke something else and was wondering if you had any ideas.
I now longer can access my regular webpages under the DocumentRoot as I am receiving the following error :
Forbidden
You don&#039;t have permission to access / on this server.
Please note that the command: apachectl status also gives me the same error.
I found that when I comment out the following three lines nested within the Directory directive, my apache doesn&#039;t error out:
...
SetHandler fcgid-script
FCGIWrapper /usr/local/bin/php-cgi .php
Options ExecCGI
...
The /var/log/httpd-error.log reads:
[warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[notice] Digest: generating secret for digest authentication ...
[notice] Digest: done
[notice] Apache/2.2.6 (FreeBSD) mod_ssl/2.2.6 OpenSSL/0.9.8e DAV/2 configured -- resuming normal operations
I&#039;m running Apache 2.2.6 against FreeBSD 7.0
Could it be file or directory permissions ?  If you have any suggestion, I&#039;d be happy to hear them.
Thanks,
Binit</description> <content:encoded><![CDATA[<p>Thanks for posting this Vivek &#8230;. While I was able to get the fastCGI to work with PHP by following your instructions, it broke something else and was wondering if you had any ideas.</p><p>I now longer can access my regular webpages under the DocumentRoot as I am receiving the following error :</p><p>Forbidden<br
/> You don&#8217;t have permission to access / on this server.</p><p>Please note that the command: apachectl status also gives me the same error.</p><p>I found that when I comment out the following three lines nested within the Directory directive, my apache doesn&#8217;t error out:</p><p> &#8230;<br
/> SetHandler fcgid-script<br
/> FCGIWrapper /usr/local/bin/php-cgi .php<br
/> Options ExecCGI<br
/> &#8230;</p><p>The /var/log/httpd-error.log reads:</p><p>[warn] Init: Session Cache is not configured [hint: SSLSessionCache]<br
/> [notice] Digest: generating secret for digest authentication &#8230;<br
/> [notice] Digest: done<br
/> [notice] Apache/2.2.6 (FreeBSD) mod_ssl/2.2.6 OpenSSL/0.9.8e DAV/2 configured &#8212; resuming normal operations</p><p>I&#8217;m running Apache 2.2.6 against FreeBSD 7.0</p><p>Could it be file or directory permissions ?  If you have any suggestion, I&#8217;d be happy to hear them.</p><p>Thanks,</p><p>Binit</p> ]]></content:encoded> </item> <item><title>By: Vivek Gite</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-39682</link> <dc:creator>Vivek Gite</dc:creator> <pubDate>Thu, 01 Jan 2009 17:07:38 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-39682</guid> <description>@root user ,
No I did not missed /usr/ports/www/mod_fcgid. Please read it carefully. Do you get any sort of error?</description> <content:encoded><![CDATA[<p>@root user ,</p><p>No I did not missed /usr/ports/www/mod_fcgid. Please read it carefully. Do you get any sort of error?</p> ]]></content:encoded> </item> <item><title>By: root user</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-39681</link> <dc:creator>root user</dc:creator> <pubDate>Thu, 01 Jan 2009 16:45:11 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-39681</guid> <description>Sucks. Doesnt work. Why you missed /usr/ports/www/mod_fcgid part?</description> <content:encoded><![CDATA[<p>Sucks. Doesnt work. Why you missed /usr/ports/www/mod_fcgid part?</p> ]]></content:encoded> </item> <item><title>By: Mel</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-37957</link> <dc:creator>Mel</dc:creator> <pubDate>Tue, 20 May 2008 15:43:47 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-37957</guid> <description>Ok, I just got done troubleshooting why &lt;em&gt;all&lt;/em&gt; documents were passed to php-cgi and as a result causing images and css to not be displayed, since php-cgi has no idea how to process png images :).
So, simplified:
. AddHandler binds a handler to a file extension
. SetHandler binds the context location to a handler.
Telltale:
[notice] mod_fcgid: process /usr/local/www/phpPgAdmin/images/themes/default/title.png(2905) exit(communication error), terminated by calling exit(), return code: 255</description> <content:encoded><![CDATA[<p>Ok, I just got done troubleshooting why <em>all</em> documents were passed to php-cgi and as a result causing images and css to not be displayed, since php-cgi has no idea how to process png images :).</p><p>So, simplified:<br
/> . AddHandler binds a handler to a file extension<br
/> . SetHandler binds the context location to a handler.</p><p>Telltale:<br
/> [notice] mod_fcgid: process /usr/local/www/phpPgAdmin/images/themes/default/title.png(2905) exit(communication error), terminated by calling exit(), return code: 255</p> ]]></content:encoded> </item> <item><title>By: vivek</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-37944</link> <dc:creator>vivek</dc:creator> <pubDate>Sat, 17 May 2008 14:45:32 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-37944</guid> <description>Mel,
Thanks for pointing out /usr/ports/www/mod_fcgid. Yes -c is the best option for virtual hosting. You can always write your own FCGIWrapper if you want.</description> <content:encoded><![CDATA[<p>Mel,</p><p>Thanks for pointing out /usr/ports/www/mod_fcgid. Yes -c is the best option for virtual hosting. You can always write your own FCGIWrapper if you want.</p> ]]></content:encoded> </item> <item><title>By: Mel</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-37942</link> <dc:creator>Mel</dc:creator> <pubDate>Sat, 17 May 2008 12:28:03 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-37942</guid> <description>What I&#039;m missing in this article is why &lt;em&gt;not&lt;/em&gt; to use fcgi.
The most important reason to stick to the module, is when your site requires settings through &lt;a&gt;php_value/php_flag &lt;/a&gt; apache configuration directives.
For example, I have several aliases and virtual hosts use different include_paths.
I now have to combine them in the system&#039;s php.ini or maybe use php-cgi -c if the FCGIWrapper statement allows this.
Also, you&#039;re missing the:
&lt;code&gt;# cd /usr/ports/www/mod_fcgid&lt;/code&gt;
Great article though, thanks for writing it up :)</description> <content:encoded><![CDATA[<p>What I&#8217;m missing in this article is why <em>not</em> to use fcgi.<br
/> The most important reason to stick to the module, is when your site requires settings through <a>php_value/php_flag </a> apache configuration directives.<br
/> For example, I have several aliases and virtual hosts use different include_paths.<br
/> I now have to combine them in the system&#8217;s php.ini or maybe use php-cgi -c if the FCGIWrapper statement allows this.<br
/> Also, you&#8217;re missing the:<br
/> <code># cd /usr/ports/www/mod_fcgid</code></p><p>Great article though, thanks for writing it up :)</p> ]]></content:encoded> </item> <item><title>By: vivek</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-37754</link> <dc:creator>vivek</dc:creator> <pubDate>Wed, 09 Apr 2008 18:41:59 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-37754</guid> <description>Thanks for the heads up. The faq has been updated.</description> <content:encoded><![CDATA[<p>Thanks for the heads up. The faq has been updated.</p> ]]></content:encoded> </item> <item><title>By: Ionut</title><link>http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/#comment-37753</link> <dc:creator>Ionut</dc:creator> <pubDate>Wed, 09 Apr 2008 18:18:35 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1011#comment-37753</guid> <description>thanks, nice.
# portsanp fetch update
has to be:
# portsnap fetch update</description> <content:encoded><![CDATA[<p>thanks, nice.</p><p># portsanp fetch update</p><p>has to be:</p><p># portsnap fetch update</p> ]]></content:encoded> </item> </channel> </rss>
