News Feed
Sections




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

Gonzalo Ayuso:
How to run a Web Server from a PHP application
November 11, 2013 @ 11:53:06

Gonzalo Ayuso has put together a post showing how (by implementing the Reactor design pattern) he created a simple web server inside a PHP application. It combines a few Symfony2 components and the React library to build a simple server in a bit more programatic way.

Normally we deploy our PHP applications in a webserver (such as apache, nginx, ). I used to have one apache webserver in my personal computer to play with my applications, but from time to now I prefer to use PHP's built-in webserver for my experiments. It's really simple. [...] With PHP we cannot do it. Sure? That assertion isn't really true. We can do it. I've just create one small library to do it in two different ways. First running the built-in web server and also running one React web server.

The idea is that all that would be needed is a stand-alone PHP script that could be run anywhere and start up its own web server, no other software required. He includes a simplified version of the example, showing how to make servers with both React and PHP's own server. He also includes an example of a basic Silex application that uses it as well as some benchmarks (with Apache ab) for each of the implementations and their request/response times on average for simple and Silex requests.

0 comments voice your opinion now!
builtin webserver server example react silex

Link: http://gonzalo123.com/2013/11/11/how-to-run-a-web-server-from-a-php-application/

blog comments powered by Disqus

Similar Posts

Dries Buytaert\'s Blog: Drupal webserver configurations compared

Jason Stiles' Blog: How To Protect Your Site From XSS With PHP

Jim Plush's Blog: PHP Socket Tutorial Part 1

The Coders Lexicon: My Love / Hate Relationship With PHP Traits

Padraic Brady's Blog: The PHPSpec Zend Framework App Testing Manifesto: ZF Integration


Community Events





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


interview library voicesoftheelephpant package list opinion deployment symfony install release api bugfix podcast community laravel introduction series framework tips language

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