https://github.com/4lb0/phps
PHP Server: An improvement for the built-in web server. It uses 8080 port by default or set option -r to use a random port. Also run LiveReload if available.
https://github.com/4lb0/phps
php server utility
Last synced: 3 months ago
JSON representation
PHP Server: An improvement for the built-in web server. It uses 8080 port by default or set option -r to use a random port. Also run LiveReload if available.
- Host: GitHub
- URL: https://github.com/4lb0/phps
- Owner: 4lb0
- License: mit
- Created: 2021-11-01T06:20:31.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-01T11:53:03.000Z (over 4 years ago)
- Last Synced: 2025-12-14T10:35:26.719Z (6 months ago)
- Topics: php, server, utility
- Language: Shell
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP Server

An improvement for the [built-in web server](https://www.php.net/manual/en/features.commandline.webserver.php).
It uses 8080 port by default or set option `-r` to use a random port.
Also run [LiveReload](https://www.npmjs.com/package/livereload) if available.
**Usage:**
phps [-r] [-t docroot] [router]
**Options:**
* `-r, --random` Run PHP and Livereload on random ports.
* `-t, --docroot` Starting with a specific document root directory
* `-h, --help` Show this help
**Set up:**
Use composer
composer global require 4lb0/phps
Or download the [phps](/phps) file.
**Save parameters in composer.json**
You may add `[-t docroot] [router]` in a custom key `phps` in the `extra` section of your composer.json.
For example if you run it `phps -r -t public app.php` add the following configuration to your composer.json and then run it with just `php -r`
"extra": {
"phps":
"router": "app.php",
"docroot": "public/",
"config": "etc/php.ini",
"extraExtensions": "scss,phtml"
}
**Requirements:**
* PHP version 5.4 or newer versions
* Bash support
* Optional: [LiveReload](https://www.npmjs.com/package/livereload)