PHP Development Web Server.

As of version 5.4.0 PHP provides a built-in web server invoked via a command line switch. The command line switch can be used in a desktop shortcut by adding it to the target property “C:\PHP\php.exe -S Localhost:80”. URI requests are served from the current working directory or the start in directory “C:\xampp\htdocs\seobydesign” another property of the shortcut, (you can leave the start in empty if you don’t mind having the shortcut in the same directory as the http documents; very useful if you set it up to run off a flash drive.)

Since PHP does not require any actual installation, just be unzipping the current archive and building a shortcut the web server is fully ready to go.

I would not except any major mentions of the web server on most development blogs. Most developers have versions of Apache running as development systems, and most servers on the internet are Apache based. Apache has many configuration options, as well as htaccess configuration, and can handle a large number of connections simultaneously. The built in PHP web server on the other hand takes very little system resources. On the fly configuration can be done by using a php script referred to in the documentation as a “router” script.

Out of the box the built in web server handles php scripts and static html and web assets. No mySQL server is provided – although mySQL servers can be installed independently. Around 25% of websites use some sort of CMS system, and 4 out of 5 of them use WordPress. WordPress uses htaccess, modredirects, and mySQL.

Still the ability to have a localhost web server up and running in less than five minutes with PHP applications makes this server very interesting. I assume the php and the html could be loaded from a CD or a memory stick.


2 responses

  1. Thanks for sharing the feature in 5.4.0. Two views are there if we just want to run applications without using MY SQL, its ok with the just PHP we accomplished the job. On the other hand, for application development, we would prefer for WAMP, XAMP or LAMP etc.

    1. Thanks for the comment.

      There are separate mysql installations and it is possible to use the mysql on a server that is accessible online. However, one of the features of the PHP server has of complete portability. As you point out for typical application development MY SQL is needed … if a site is under development the site can be used without MySQL the client can be sent a zip with his site so he can QC it on his system. A portable MySQL server would be nice.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: