You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-71Lines changed: 32 additions & 71 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,4 @@
1
-
2
-
# PHP HTTP Server
1
+
# PHP HTTP Server [](https://packagist.org/packages/arishem/php-http-server)
3
2
4
3
A lightweight, dependency-free HTTP server written in PHP. This server supports basic routing, middleware, and WebSocket integration, and is designed to be modular and easy to extend.
5
4
@@ -18,7 +17,7 @@ A lightweight, dependency-free HTTP server written in PHP. This server supports
18
17
19
18
### Prerequisites
20
19
21
-
- PHP 7.4 or higher.
20
+
- PHP 8.3 or higher.
22
21
- Basic knowledge of PHP and HTTP.
23
22
24
23
### Installation
@@ -58,81 +57,43 @@ To start the server, run:
58
57
59
58
The server will listen on `http://localhost:8080` by default. You can customize the host and port by modifying the `Server` constructor in `public/index.php`.
60
59
61
-
---
62
-
63
-
### Handling Requests
64
-
65
-
The server parses incoming HTTP requests into a `Request` object, which provides the following methods:
66
-
67
-
-`getMethod()`: Returns the HTTP method (e.g., `GET`, `POST`).
68
-
-`getUri()`: Returns the request URI (e.g., `/`, `/users/123`).
69
-
-`getHeaders()`: Returns an associative array of request headers.
0 commit comments