News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DevShed:
Emulating a Basic Web Server with Sockets in PHP
June 05, 2006 @ 14:35:05

DevShed has posted the third part of their "handling sockets in PHP" series today, taking things one step further than the basic TCP server from before and making a basic web server.

It's time to pay attention to the subject of this final part of the series. In this article, I'll show you how to use low-level sockets to emulate the functionality of a basic Web server on your own testing machine.

They start with a quick look back, mentioing what the simple TCP server could do and (briefly) how it worked, including its entire code. Since it was simple to extend, they create a new class, WebServer, to add the functionality it needs to response as a web server. It's made to serve up one file - a static HTML - whenever the user hits it with a request.

His simple server dosen't conform to any of the standards, but it does transmit data out over the standard port in an HTML format. It's a step in the right direction...

1 comment voice your opinion now!
sockets handling part3 simple webserver static html sockets handling part3 simple webserver static html


blog comments powered by Disqus

Similar Posts

Nessa's Blog: Common PHP Errors

David Sklar's Blog: Runkit, "static", and inheritance

Felix Geisendorfer's Blog: How-to: Use Html 4.01 in CakePHP 1.2

PHPBuilder.com: A Primer On Postgres Exception Handling For The PHP Developer, Part 2

PHPBuilder: A Primer On Postgres Exception Handling For The PHP Developer


Community Events











Don't see your event here?
Let us know!


hhvm overview application code symfony2 hack composer opinion install introduction security facebook package unittest example podcast release framework language component

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework