{"id":16347750,"url":"https://github.com/oscarotero/php-server-manager","last_synced_at":"2025-03-21T00:30:21.810Z","repository":{"id":57323268,"uuid":"111233987","full_name":"oscarotero/php-server-manager","owner":"oscarotero","description":"Manage PHP built-in server in node","archived":false,"fork":false,"pushed_at":"2019-09-02T22:14:52.000Z","size":17,"stargazers_count":29,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-01T00:58:38.283Z","etag":null,"topics":["php-server"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/php-server-manager","language":"JavaScript","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/oscarotero.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-18T19:44:37.000Z","updated_at":"2024-04-21T21:27:38.000Z","dependencies_parsed_at":"2022-09-21T00:51:03.186Z","dependency_job_id":null,"html_url":"https://github.com/oscarotero/php-server-manager","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarotero%2Fphp-server-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarotero%2Fphp-server-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarotero%2Fphp-server-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarotero%2Fphp-server-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oscarotero","download_url":"https://codeload.github.com/oscarotero/php-server-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244092768,"owners_count":20396868,"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","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-server"],"created_at":"2024-10-11T00:45:39.290Z","updated_at":"2025-03-21T00:30:21.528Z","avatar_url":"https://github.com/oscarotero.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Server Manager\n\nPackage to manage the PHP built-in server from node.\n\n## Install\n\n```\nyarn add php-server-manager\n```\n\n## Usage\n\n```js\nconst PHPServer = require('php-server-manager');\n\nconst server = new PHPServer();\n\nserver.run(cb); // http://localhost:8000\n```\n\n## Callback vs Promise\n\nYou can pass a callback to the run method, this will get called when the PHP server is up and running. If you don't pass a callback to the run method, a promise will be returned that resolves when the PHP server is up and running.\n\n## Configuration\n\nName | Default | Description\n-----|---------|------------\n`php` | `php` | The php command file\n`host` | `127.0.0.1` | The server's host\n`port` | `8000` | The port used\n`directory` | `null` | The document root. By default is the current working directory\n`script` | `null` | The \"router\" script\n`stdio` | `inherit` | stdio option passed to the spawned process - https://nodejs.org/api/child_process.html#child_process_options_stdio\n`directives` | `{}` | An object with the custom PHP directives\n`config` | `null` | The path of a custom php.ini file\n`env` | `process.env` | The environment variables passed\n\nExample:\n\n```js\nconst PHPServer = require('php-server-manager');\n\nconst server = new PHPServer({\n    port: 3000,\n    directives: {\n        display_errors: 0,\n        expose_php: 0\n    }\n});\n\nserver.run();\n```\n\n## Quick use\n\nYou can use the static function `start()` to create and run a PHPServer in a single line:\n\n```js\nPHPServer.start();\n```\n\n## Use with gulp\n\n```js\ngulp.task('php-server', () =\u003e\n    PHPServer.start({\n        directory: 'public',\n        script: 'public/index.php'\n    })\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foscarotero%2Fphp-server-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foscarotero%2Fphp-server-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foscarotero%2Fphp-server-manager/lists"}