I have a hosted site and I\'m having trouble configuring Joomla (running Joomla + php + mySQL on IIS7 + win server 2008). I have a similar configuration running on a local m
You can use (on centos) apachectl -M
, you'll show what modules are enabled:
apachectl -M:
file_cache_module (shared)
mem_cache_module (shared)
version_module (shared)
fastcgi_module (shared)
Make sure things are set up initially to where the script fails completely when fastcgi isn't running. Then you'll know, when it works, that fastcgi daemon is the reason.
Here's a simple test:
<?php phpinfo(); ?>
inside;
Request http://yoursite.com/phpinfo.php/foobar?foo=bar
Check the output of phpinfo and look for _SERVER["REQUEST_URI"].
If this variable is missing, then CGI is used. If the variable is present and correctly set to /phpinfo.php/foobar?foo=bar, then either ISAPI or FastCGI is used. Look near the top of the output for Server API; it should be set to either ISAPI (which means ISAPI is being used) or CGI/FastCGI (which means FastCGI is being used, since we already ruled out CGI).
You should see a referenced to it from
<?php
phpinfo();
?>
Server API = CGI/FastCGI
Joomla creates a .htaccess file with rewrite rules in it to enable search engine friendly URLs. If you're using Apache you will need to have to set "AllowOverride FileInfo" for the directory containing your joomla installation. If you are using IIS you will need a module such as IISModRewrite. Here are instructions for this: [http://www.micronovae.com/ModRewrite/articles/SEFJoomla.html]
Unfortunately, the checking \_SERVER["REQUEST_URI"]
didn't work for me. Using CGI or FastCGI, it always displayed /phpinfo.php/foobar?foo=bar
.
Neither did seeing if Server API = CGI/FastCGI
was set - that only tells you what interfaces the compiled version of php supports, not what is being used. However, I found another method that may work more reliably.
Plonk a file in place called phpinfo.php containing the text: <? php phpinfo(); ?>
Check for the variable \_ENV["REDIRECT_HANDLER"]
:
If it is set to php5-fastcgi
(or something else fastcgi-ish) the request most probably went through FastCGI. If it is set to application/x-httpd-php
(or I assume something other than the above), you are using CGI.
However, a surefire way is by running a little test. You need the ab
(Apache Bench) tool for this.
Both with and without CGI, run this from another machine:
ab -c 100 -n 1000 http://yourdomain.com/path/phpinfo.php
Check the line Time taken for tests:
. On my box at least, accessing my VPS over a 1.3Mbps ADSL connection, FastCGI completely maxed it out, while with CGI was only able to fill half of it.
Hope this helps.