Jump to content

Web Server


The Little Guy

Recommended Posts

Another question.

 

When Apache requests a PHP page, how does it say "Run the PHP parser on this file"? The way I assumed that it does it, is it runs the PHP command, in a shell or command line environment, such as an execute function or something of that nature.

 

Would this be a fair assumption or not? To me, I feel that it may be extra work for it, but maybe I am wrong.

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/147699-web-server/#findComment-776602
Share on other sites

TLG, the way you just described it is essentially running PHP in CGI mode.

 

 

When it's loaded as an extension, it has a certain API that Apache uses to tell it "hey, do something with this file."

 

Modules are usually always loaded, so they are usually a bit faster than initiating an executable.

Link to comment
https://forums.phpfreaks.com/topic/147699-web-server/#findComment-776717
Share on other sites

You want to make your web server compatible with the PHP module for Apache?

 

 

That's quite a large task.

 

 

http://modules.apache.org/reference.php

 

 

You of course wouldn't have to implement all of the Apache API handling in your server, but I would imagine PHP uses quite a large chunk of it.

Link to comment
https://forums.phpfreaks.com/topic/147699-web-server/#findComment-776794
Share on other sites

You want to make your web server compatible with the PHP module for Apache?

 

No, I would like to make my server compatible with PHP, so I can run php with my web server.

 

So.. If Apache is forwarding the PHP to the parser/interpreter, how would it do that, and how would It get the information back?

 

 

In CGI mode, mod_cgi handles it.  In extension mode, the PHP Apache extension is coded around the Apache module API.

 

 

I'm not quite sure how PHP in CGI mode works.

 

 

I know that CGI applications take in POST data on stdin and other stuff is in environmental variables, but I don't know if PHP follows the CGI specs.

Link to comment
https://forums.phpfreaks.com/topic/147699-web-server/#findComment-776851
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.