inets & PHP

ke.han ke.han@REDACTED
Sun Nov 27 19:33:43 CET 2005

Sanjaya Vitharana wrote:
> Hi .... Twan !!!
> 1.) I have PHP pages already running on Apache
> 2.) Also I have a inets (HTTP Server) httpd which replies to the 
> specific http requests, accessing the mnesia db.
> 3.) Since inets is also act as a HTTP Server, can't I put the php pages 
> on same server rather than using 2 web servers ? (Apache & inets)
> Just interested, no special need to user PHP over inets.
> Also,
> Apache, inets, & yaws all 3 are webservers. So why yaws supports PHP 
> after Apache ? Rather than providing support for PHP they could guid 
> their user to use Apache, dosen't it ?
> So why not thinking about PHP over inets ? And why Erlang include inets 
> as their web server ? They also could simply put the Yaws as their web 
> server or redirect their user to yaws. Why they don't do that?

Erlang includes inets because it was created by Ericsson and erlang is 
released and maintained by Ericsson.  Yaws is not an Ericsson project 
developed because at the time, inets did not provide as high-level a 
framework for the needs of its creator (My guess this is still true). 
This is simple co-evolution...happens all the time, even in a small 
ecosystem like Erlang.  Inets will stick around because legacy code 
depends on it and I'm sure some users who don't need the same 
architecture Yaws provides choose inets instead.

Bottom line: If you are new to Erlang and want a solid, scalable, full 
featured web server and application framework for serving up a simple or 
complex web site, Yaws is the best game in town.  If you need to develop 
a new web app and want to use an existing PHP app embedded as a part of 
the whole, Yaws is a great choice using CGI as Claes pointed out.  Yes, 
FastCGI would be nicer and given the user base Yaws is enjoying its 
likely to be just around the corner ;-).

As to CGI/FastCGI use with Erlang.  If you can afford to take the time 
to manage your own interface to an external app in Java or Python for 
example, using an Erlang Port Interface like JInterface should give 
better resource management and performance than even FastCGI would give. 
  Hopefully "PHPInterface" for Erlang is just around the corner as well.

Good luck and happy Yaws'ing...

ke han

More information about the erlang-questions mailing list