{"id":21891201,"url":"https://github.com/kamalkhan/web-server","last_synced_at":"2026-04-15T07:34:36.336Z","repository":{"id":62493930,"uuid":"210164372","full_name":"kamalkhan/web-server","owner":"kamalkhan","description":"Run a web server programmatically via PHP.","archived":false,"fork":false,"pushed_at":"2020-03-28T10:26:46.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-29T14:24:56.399Z","etag":null,"topics":["php","process","programmatic","web-server"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kamalkhan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-22T14:52:17.000Z","updated_at":"2020-03-28T10:25:00.000Z","dependencies_parsed_at":"2022-11-02T11:31:22.347Z","dependency_job_id":null,"html_url":"https://github.com/kamalkhan/web-server","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kamalkhan/web-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamalkhan%2Fweb-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamalkhan%2Fweb-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamalkhan%2Fweb-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamalkhan%2Fweb-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kamalkhan","download_url":"https://codeload.github.com/kamalkhan/web-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamalkhan%2Fweb-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019319,"owners_count":26086711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","process","programmatic","web-server"],"created_at":"2024-11-28T12:21:52.063Z","updated_at":"2025-10-14T15:34:43.706Z","avatar_url":"https://github.com/kamalkhan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Web Server\n\n[![Travis Build Status][icon-status]][link-status]\n[![Packagist Downloads][icon-downloads]][link-downloads]\n[![License][icon-license]](LICENSE.md)\n\nRun and/or control a web server programmatically.\n\n- [Install](#install)\n- [Usage](#usage)\n  - [PHP Web Server](#php-web-server)\n    - [Public path](#public-path)\n    - [Host](#host)\n    - [Port](#port)\n    - [URL](#url)\n- [API](#api)\n  - [Start a web server](#start-a-web-server)\n  - [Stop a web server](#stop-a-web-server)\n  - [Check the running state of a web server](#check-the-running-state-of-a-web-server)\n  - [Get the path to the server](#get-the-path-to-the-server)\n  - [Get the URL of the server](#get-the-url-of-the-server)\n- [Changelog](#changelog)\n- [Testing](#testing)\n- [Contributing](#contributing)\n- [Security](#security)\n- [Credits](#credits)\n- [License](#license)\n\n## Install\n\nYou may install this package using [composer][link-composer].\n\n```shell\n$ composer require bhittani/web-server --prefer-dist\n```\n\n## Usage\n\nBy default, this package offers a php web server that uses the built-in development server.\n\n### PHP Web Server\n\nThis uses the built-in development server.\n\n```php\n\u003c?php\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$webServer = new \\Bhittani\\WebServer\\Php('/path/to/www/public/index.php');\n```\n\n#### Public path\n\n```php\n\u003c?php\n\n$webServer-\u003epath('/path/to/www/public');\n```\n\n\u003e The default path is set to the directory of the server file.\n\n#### Host\n\n```php\n\u003c?php\n\n$webServer-\u003ehost('127.0.0.1');\n```\n\n\u003e The default host is set to `localhost`.\n\n#### Port\n\n```php\n\u003c?php\n\n$webServer-\u003eport(3000);\n```\n\n\u003e The default port is set to `9001`.\n\n#### URL\n\n```php\n\u003c?php\n\n$webServer-\u003eurl('https://localhost');\n```\n\n\u003e The default url is set to `http://\u003chost\u003e:\u003cport\u003e`.\n\n## API\n\nThe following API will be available for any web server adhering to the contract/interface.\n\n### Start a web server\n\n```php\n\u003c?php\n\n$webServer-\u003estart();\n```\n\n### Stop a web server\n\n```php\n\u003c?php\n\n$webServer-\u003estop();\n```\n\n### Check the running state of a web server\n\n```php\n\u003c?php\n\n$webServer-\u003eisRunning();\n```\n\n### Get the path to the server\n\n```php\n\u003c?php\n\n$webServer-\u003egetPath();\n```\n\n### Get the URL of the server\n\n```php\n\u003c?php\n\n$webServer-\u003egetUrl();\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed.\n\n## Testing\n\n```shell\ngit clone https://github.com/kamalkhan/web-server\n\ncd web-server\n\ncomposer install\n\ncomposer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email `shout@bhittani.com` instead of using the issue tracker.\n\n## Credits\n\n- [Kamal Khan](http://bhittani.com)\n- [All Contributors](https://github.com/kamalkhan/web-server/contributors)\n\n## License\n\nThe MIT License (MIT). Please see the [License File](LICENSE.md) for more information.\n\n\u003c!--Status--\u003e\n[icon-status]: https://img.shields.io/travis/kamalkhan/web-server.svg?style=flat-square\n[link-status]: https://travis-ci.org/kamalkhan/web-server\n\u003c!--Downloads--\u003e\n[icon-downloads]: https://img.shields.io/packagist/dt/bhittani/web-server.svg?style=flat-square\n[link-downloads]: https://packagist.org/packages/bhittani/web-server\n\u003c!--License--\u003e\n[icon-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n\u003c!--composer--\u003e\n[link-composer]: https://getcomposer.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamalkhan%2Fweb-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamalkhan%2Fweb-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamalkhan%2Fweb-server/lists"}