


- HTML EXECUTABLE HOW TO USE BUILT IN SERVER MANUAL
- HTML EXECUTABLE HOW TO USE BUILT IN SERVER PORTABLE
- HTML EXECUTABLE HOW TO USE BUILT IN SERVER CODE
You can test the server by creating a basic index.php file in the your current directory which contains a call to phpinfo(), and then launching the server like so: ~]$ php -S :8080 You can then determine if the server is available in your build by running php -h and looking for the -S and -t options which are specific to the server. To verify your version of PHP, invoke php -v in a terminal. You’ll need to have PHP 5.4 or greater installed to use the built-in server. I’m sure you’re just as anxious as I am to get started, so let’s do it!
HTML EXECUTABLE HOW TO USE BUILT IN SERVER PORTABLE
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. But I’m quite sure that someone out there (maybe one of you, why not?) will write and adapter for this features and I’d like to be the first to test it.

Well, it’s not so simple at first because a lot of apps are written with Apache in mind and make use of. With PHP’s built-in server, I could test the application right from my download or temp directories and then move it to my regular environment only if I really need to. On my machine for example I use OSX’s pre-installed Apache with a custom configuration that suits my development style, but sometimes I want to try a some new webapp. There are no special INI directives for it except for one (which colorizes logging output sent to the console), and the general tone of the documentation seems to be “we too have a web server now, stop bothering us.”ĭespite this, the server made it in version 5.4, and it’s my opinion it can be a valuable tool for both developing and testing.
HTML EXECUTABLE HOW TO USE BUILT IN SERVER MANUAL
Indeed the PHP manual stresses that the new built-in server is intended for development use only and recommends against using it in production. Besides, most systems today come with a personal web server already installed or installable with a few commands or clicks. They’ll argue PHP doesn’t need a built-in server. Some may point out that PHP is a language originally designed to be used on the web in the first place, while other languages like Python and Ruby are not, so it makes more sense for the others to provide a basic server environment to help kick-start web development. For example, you could distribute portable web applications on CD ROMs or USB sticks, or even as desktop applications, all created with PHP without needing GTK or other graphic libraries. The server lends itself to other creative uses, too.
HTML EXECUTABLE HOW TO USE BUILT IN SERVER CODE
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. One of the cooler features of the new PHP 5.4 release is a built-in web server designed specifically for development and testing.
