LoadModule vs. action

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rallykarro@hotmail.com

    LoadModule vs. action

    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\php5apa che2_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

    #2
    Re: LoadModule vs. action

    *** rallykarro@hotm ail.com escribió/wrote (10 Aug 2006 12:49:10 -0700):
    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\php5apa che2_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.

    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
    --

    Comment

    • R. Rajesh Jeba Anbiah

      #3
      Re: LoadModule vs. action

      rallykarro@hotm ail.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\php5apa che2_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 = GetRequestedFil e();

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

      CGI mode:

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

      switch(GetFileT ype($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/

      Comment

      Working...