|Ratings|| ||Unique User Downloads|| ||Download Rankings|
|Not enough user ratings||Total: 458 ||All time: 6,067 This week: 321|
This package implements a HTTP server that can take virtual host requests.
It can listen to HTTP requests in a given port of the local machine and handle the requests serving files of the server machine.
The server can handle requests to multiple virtual host names according to definitions read from a separate configuration file.
The request path may be rewritten according to rules defined in the configuration.
Requests that map to files with the .php file name extension will cause the server to execute respective PHP scripts to generate the request response.
It can also cache the responses of requests that match a given path pattern.
Responses can be compressed with the gzip or deflate methods if defined in the configuration.
Prize: One copy of the Zend Studio
|HTTP servers are very common but they are often separate programs that you need to install to use together with PHP.
Nowadays PHP comes with a built-in HTTP server but it is still very limited.
This class implements a pure PHP HTTP server that implements more complex features like virtual host support, URL rewriting, caching, etc..
This is a http server for PHP completely written in PHP - HttpServer.
> Why do you do this?
> - Because I can.
GET and POST requests.
PHP files starting (with properly filled _SERVER, _POST, _GET, _COOKIE) and static files downloading.
Forking on any request to avoid delays.
Compression gzip, deflate.
All configuration in file httpserver.configuration.
It has blocks and directives inside blocks.
For example, this is default configuration:
replace (.+) /index.php?$1 not_exist;
Some special host names:
global - is not a hostname. It is server configuration.
default - is default hostname. If user did not provide host this host will be used.
Inside server configuration following directives available.
Inside a block following directives available.
> Specifies root folder for hostname. Must not end with slash.
replace [what] [with that] [flags].
> Allows replace requested path with regular expressions. First argument is an regular expression. Second is a destination path. (Must start with slash). Last arg is flags. not_exist flag changes behavior of replacement: if requested path exist, even if path matches expression, replacement will not be performed.
> Sets available compression methods for response generation. Available: gzip,defalte.
> Specifies additional directives for special path(s).
cache [cache timeout].
> Tells server to add Cache header in response.
Download and unpack archive
Update with composer (`composer update`)
Run bin/httpserver (`php bin/httpserver`)
||Applications that use this package
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.