Apache module or PHP module ?

Apache module or PHP module ?

Post by Mickael Faivre-Mac » Wed, 13 Nov 2002 03:38:48



Hi,

I have written a database tool on Windows as a COM components (module)
for ASP. This component simply help me display DB data in an ASP page
using templates (like ColdFusion, I guess), so DB access is written in
C++ and not in Javascript (or VBScript).

I switched to Linux recently and I would like to port my tool.

I think it is best for me to develop my web sites using Apache, PHP,
MySQL, but I still want to port my tool and access DB with C++, and
not let PHP do it, so I can still use my scripts and templates. (If
you have another suggestion, please tell me).

But I am bit confused now about what kind of module I should write.
First I thought that I should write a PHP module in C++ and call it in
PHP (like I am doing now, calling my C++ COM Components in my ASP
pages). Then I read about Apache modules.

Could someone explain me what is the difference between a apache
module and a PHP module, and what solution should be the best for my
problem ?

Mickael.

 
 
 

Apache module or PHP module ?

Post by Sundial Service » Wed, 13 Nov 2002 04:35:50



> [...]
> But I am bit confused now about what kind of module I should write.
> First I thought that I should write a PHP module in C++ and call it in
> PHP (like I am doing now, calling my C++ COM Components in my ASP
> pages). Then I read about Apache modules.

> Could someone explain me what is the difference between a apache
> module and a PHP module, and what solution should be the best for my
> problem ?

First of all, notice that when you're using PHP, the PHP language system is
probably implemented as an Apache module:  mod_php4.

An Apache module is simply a library of routines that is designed to be
loaded and called by the Apache server engine.  As such it can apply to any
and all web-sites hosted through that server.  

Apache has a definite internal structure, and a flow-chart through which all
of its workload moves.  Apache modules are designed to be called at
specific points throughout that flow, as documented in the Apache docs.

The PHP interpreter also has its own notion of modules, in the sense that
you can add function-calls to the language which are written in something
like C++.  These modules extend the PHP language and can only be used
within PHP.  Some of these modules exist to allow PHP programs to refer to
features that are implemented by Apache within other Apache modules.  (As
such, they require that PHP also must be operating as an Apache module, and
therefore in the context of an Apache worker-process.)

----------------------------------
Fast automatic Paradox table repair at a click of a mouse!
http://www.sundialservices.com/products/chimneysweep

 
 
 

Apache module or PHP module ?

Post by Martin Wickma » Thu, 14 Nov 2002 02:13:02


[chop]

Quote:> The PHP interpreter also has its own notion of modules, in the sense that
> you can add function-calls to the language which are written in something
> like C++.  These modules extend the PHP language and can only be used
> within PHP.  Some of these modules exist to allow PHP programs to refer to
> features that are implemented by Apache within other Apache modules.  (As
> such, they require that PHP also must be operating as an Apache module, and
> therefore in the context of an Apache worker-process.)

Adding some more info:

Most of php's standard functions are in fact php extensions which
comes included with the distribution. A php extension can either be
compiled staticly into mod_php or as a "php library" which can be
loaded into php using the dl() function or similar. Download the
latest php sources and check out the ext/ directory. Each subdir
contains an extension such as ldap, gd, bc, curl, xml, image and loads
of others. Here is a list: http://www.php.net/manual/en/funcref.php

 
 
 

1. conf.modules vs. modules.conf & modules.dep??

Just upgraded my RH6.2 box to kernel 2.2.18 (in conjunction with
applying vpn masq patch).  Now I notice that it complains about
conf.modules, so I renamed this to conf.modules.old and made a copy as
modules.conf.  Now it complains that modules.conf is newer than
modules.dep.  And, in any case, it doesn't seem to load my modules
(specifically 3c509.o for ethernet).

My present workaround is just to manually invoke this module (modprobe
3c509) and restart /etc/rc.d/init.d/network (as well as dhcpd and
named), but I know there's gotta be a "Right Way" of doing this.

What's different between 2.2.18 and my old kernel (2.2.14-5.0) in
terms of handling these files?  And, more importantly, how do I
correct this situation?  Many thanks, in advance.

2. Pthreads in IRIX6.X

3. PHP as Apache Module with user privilages

4. process defunct

5. Apache PHP Module and DB2

6. Problem with QListView (Qt widget) & Sorting

7. Please Help with PHP Apache module

8. Can't boot Windows XP after installing Redhat 8

9. Apache PHP module problem

10. Apache PHP/FI module on HPUX?

11. apache and PDF compiled into PHP module

12. Apache 1.2.4 config/run problem with PHP/FI module.

13. Compiling apache with PHP module