Well, here is some really good news for the PHP Development community. Till now (as of PHP 5.3) all developers had to set up a web-server environment such as Apache in order to test all their PHP codes. Not only this, apart from installing the server environment developers also have to configure the necessary modules that come with Apache web server.

And after all this setup is done, all the codes and necessary files had to be moved to the DocumentRoot which is ideally inside the /var/www folder after which developers are also required to take care of the file permissions in order to ensure smooth functioning and execution of the scripts.

Come PHP 5.4.0 and developers will no longer require to go through all these hassles required in setting up an web server in order to develop and test their PHP web applications. PHP 5.4.0 will have a built in web development server which can be started right inside the same folder where you are developing your project codes. If you have worked with Python ever, then you will know that this functionality has been available on Python for quite some time!

For eg. this command will start a web server for running / testing your PHP codes with documentroot as the folder from which you run this command and port number as specified (1291 in this case).

$ php -S localhost:1291

After the server is started, you can access / execute all the codes in your browser at:http://localhost:1291. You can also specify a different document root when you start the server, in this fashion:

$ php -S localhost:1291 -t /path/to/docroot

However, one important feature that this lacks is the support for SSL. Using this built in server you won’t be able to access https:// which at times are necessary for testing your code, for instance Facebook Applications.

source – http://digitizor.com/2011/12/22/php-54-built-in-erver/

Related Posts