You are here: Re: LoadModule vs. action « PHP Programming Language « IT news, forums, messages
Re: LoadModule vs. action

Posted by R. Rajesh Jeba Anbiah on 11/08/17 11:55

rallykarro@hotmail.com wrote:
> 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/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация