arishem / php-http-server
A lightweight, in-house PHP HTTP server with WebSocket support.
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/arishem/php-http-server
Requires (Dev)
- phpunit/phpunit: ^11.5
README
A minimal PHP-based HTTP server implementation and examples. Designed for local development and educational purposes — demonstrates basic request handling, routing, and response generation in PHP.
Features
- Simple HTTP request handling
- Minimal routing examples
- Easy to run for local development and demos
Requirements
- PHP 7.4+
Installation
Clone the repository:
git clone https://github.com/DeveloperKeshavKumar/php-http-sever.git
cd php-http-sever
Running the server
There are two common ways to run a minimal PHP HTTP server locally:
- Using PHP built-in web server (recommended for quick testing)
php -S 127.0.0.1:8080 -t public
- If an entry script is provided (e.g.
server.phporrun.php)
php server.php
Replace server.php with the actual script name if present.
Examples
Describe examples or endpoints that the repo contains, e.g.
- GET / -> returns "Hello World"
- GET /status -> returns 200 OK with JSON
(Replace or expand sections above with concrete examples from the code.)
Contributing
Contributions are welcome. Please open an issue to discuss changes or send a pull request.
License
This repository is available under the MIT License. See the LICENSE file for details.