Connecting Tech Pros Worldwide Forums | Help | Site Map

LoadModule vs. action

rallykarro@hotmail.com
Guest
 
Posts: n/a
#1: Aug 10 '06
Hi,

a simple question regarding ways of loading php as a dll or an exe file
in httpd?
What is the difference of loading php as LoadModule php5_module
"C:\php\php5apache2_2.dll" or Action application/x-httpd-php
"/php/php-cgi.exe" or Action application/x-httpd-php "/php/php.exe".

Either way, what is the most preferable way and why?

regards,

karolina


Alvaro G. Vicario
Guest
 
Posts: n/a
#2: Aug 10 '06

re: LoadModule vs. action


*** rallykarro@hotmail.com escribió/wrote (10 Aug 2006 12:49:10 -0700):
Quote:
a simple question regarding ways of loading php as a dll or an exe file
in httpd?
What is the difference of loading php as LoadModule php5_module
"C:\php\php5apache2_2.dll" or Action application/x-httpd-php
"/php/php-cgi.exe" or Action application/x-httpd-php "/php/php.exe".
LoadModule loads PHP as Apache module, while Action loads PHP as CGI
script.

Quote:
Either way, what is the most preferable way and why?
The module version is supposed to offer performance benefits over good old
CGI interface.


--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
R. Rajesh Jeba Anbiah
Guest
 
Posts: n/a
#3: Aug 13 '06

re: LoadModule vs. action


rallykarro@hotmail.com wrote:
Quote:
Hi,
>
a simple question regarding ways of loading php as a dll or an exe file
in httpd?
What is the difference of loading php as LoadModule php5_module
"C:\php\php5apache2_2.dll" or Action application/x-httpd-php
"/php/php-cgi.exe" or Action application/x-httpd-php "/php/php.exe".
>
Either way, what is the most preferable way and why?
To explain the difference:

mod_php:

<?php
//apache.php

//PHP as module
function ModPHP($file)
{
$output = ... //Process the file
return $output;
}

$file = GetRequestedFile();

switch(GetFileType($file))
{
case 'php':
echo ModPHP($file);
break;
case 'perl':
echo ModPerl($file);
break;
...
}
?>

CGI mode:

<?php
//apache.php
$file = GetRequestedFile();

switch(GetFileType($file))
{
case 'php':
echo system('/usr/bin/php.exe '. $file);
break;
case 'perl':
echo system('/usr/bin/perl '. $file);
break;
...
}
?>

That explains why mod_php is preferred.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Closed Thread