News Feed
Sections




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

PHPMaster.com:
Taking Advantage of PHP's Built-in Server
March 08, 2012 @ 08:17:45

On PHPMaster.com today there's a new tutorial for those on the bleeding edge of PHP using the latest released version (5.4) and a feature that comes with it - using the built-in webserver that comes bundled for testing purposes.

One of the cooler features of the new PHP 5.4 release is a built-in web server designed specifically for development and testing. Now you can write and test your code without having to have a full-fledged LAMP configuration - just launch a the built-in server from the command line, test your code, and then shut it down when you're finished. [...] In this article I'll explain some basic uses of the new built-in server and show you how to build a portable personal development server useful for quickly testing your applications

He starts with a look at how to start up the web server (a simple command line switch and host/port definition) and the resulting default phpinfo page it displays. Other options include the ability to specify a document root for your server and create a sort of "front controller" for it to route requests. They show how to create a simple application based on this that can dynamically load in the index file, a router and pass the request off to the correct file. Their example includes some "niceties" too like logging, "hosts allowed" and checks for requesting directories.

You can find their full code for this example over on github.

0 comments voice your opinion now!
builtin server recent router feature test custom tutorial


blog comments powered by Disqus

Similar Posts

ZD Net Asia: Keep your options open with FTP file uploads

The Bakery: ToniAcl Component Tutorial

NetTuts.com: Taming Slim 2.0

RIAZone: Communicating with Flex and PHP over Sockets

PHPRiot.com: Monitoring File Uploads using Ajax and PHP


Community Events





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


update voicesoftheelephpant interview laravel series symfony security community version podcast package framework mvc opinion tool release introduction library language composer

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