Introducing Phase Server - PHP Web Server. Phase Server is a simple and lightweight web server written in PHP which can serve up PHP web pages as well as static content (images, css, javascript, etc.).
Current Version: 0.1
Last Modified: 6th March 2011
Download: phaseserver_0.1.zip
Licence: GPL v2
Why?
Phase Server can be used to view PHP web pages in a web browser without the need for a fully functioning web server. Simply copy the single Phase Server PHP file to your hard drive and run it using the PHP command line utility (as below).
Supported Features
The web server will:
- listen on an address and port that you optionally specify. The default is 127.0.0.1:80.
- serve any files from a directory that you optionally specify. The default is the directory you are running the server script from.
- serve index.php (if it exists) as the default document.
- show any PHP errors in the command line window.
In version 0.1, only the GET method is supported. Plans for handling POST requests are underway.
Installing/Running Phase Server
- Download/install PHP from www.php.net.
- Edit the default php.ini file to uncomment the line "extension=php_sockets.dll"
- Run the Phase Server script using the PHP command line (examples below).
On Windows, to use the default settings, in a command prompt enter:
C:\path\to\php.exe phaseserver.php
On Windows, to specify settings, in a command prompt enter:
C:\path\to\php.exe phaseserver.php 127.0.0.1 80 C:\www
On Windows you can make this process easier by creating a command line batch file.
- In notepad enter:
C:\path\to\php.exe phaseserver.php 127.0.0.1 80 C:\www
pause
- Save it as "PhaseServer.bat"
- Start the server by opening this file. You can also add this to your computer's start up tasks.
Future Features
These are the intended features which will be available in future versions of Phase Server:
- Handling of POST requests
- Routing of virtual paths by either specifying a PHP file or reading and parsing a .htaccess file.
- Session handling
If you would like to suggest any new features, please use the comments section below or the contact form.