• Stars
    star
    106
  • Rank 324,900 (Top 7 %)
  • Language
    PHP
  • License
    MIT License
  • Created about 8 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Reverse proxy for PHP built-in server which supports multiprocessing and TLS/SSL encryption

PHP Hyper Built-in Server Build Status Scrutinizer Code Quality

Reverse proxy for PHP built-in server which supports multiprocessing and TLS/SSL encryption.

Installing

Global install

composer global require mpyw/php-hyper-builtin-server:^3.0

If not yet, you must add ~/.composer/vendor/bin to $PATH.
Append the following statement to ~/.bashrc, ~/.zshrc or what not.

export PATH="$HOME/.composer/vendor/bin:$PATH"

Local install only for development environment

composer require --dev mpyw/php-hyper-builtin-server:^3.0

Use vendor/bin/hyper-run as the execution path.

Usage

Quick start

hyper-run -S localhost -s localhost -t src/app/www

2 servers will start with the directory src/app/www as the document root:

  • http://localhost:8000
  • https://localhost:44300

Servers start with first unoccupied port within range depending on a scheme.

Scheme Default Range
HTTP 8000 8000-8099
HTTPS 44300 44300-44399

Customize ports

hyper-run -S localhost:8080 -s localhost:4000 -t src/app/www

2 servers will start with the directory src/app/www as the document root:

  • http://localhost:8080
  • https://localhost:4000

Command Reference

mpyw@localhost:~$ hyper-run -h

Usage:
    hyper-run <options>

Example:
    hyper-run -S localhost:8000 -s localhost:44300

[Required]
    -S   "<Host>:<Port>" of an HTTP server. Multiple arguments can be accepted.
    -s   "<Host>:<Port>" of an HTTPS server. Multiple arguments can be accepted.

[Optional]
    -n   The number of PHP built-in server clusters, from 1 to 20. Default is 10.
    -t   Path for the document root. Default is the current directory.
    -r   Path for the router script. Default is empty.
    -c   Path for the PEM-encoded certificate.
         Default is "/Users/mpyw/.composer/vendor/mpyw/php-hyper-builtin-server/certificate.pem".

Restrictions:
    - The option -s is only supported on PHP 5.6.0 or later.
    - Access logs will not be displayed on Windows.

mpyw@localhost:~$

Note for Windows users

Unfortunately, cmd.exe has no option to run via shebang #!/usr/bin/env php, so you need to create the following batch file in the proper directory.

For Standalone PHP

@echo OFF
"C:\php\php.exe" "%HOMEPATH%\.composer\vendor\mpyw\php-hyper-builtin-server\hyper-run" %*

For XAMPP

@echo OFF
"C:\xampp\php\php.exe" "%HOMEPATH%\.composer\vendor\mpyw\php-hyper-builtin-server\hyper-run" %*

License

  • PHP Hyper Built-in Server is open-sourced software licensed under the MIT license by @mpyw.

More Repositories

1

axios-case-converter

Axios transformer/interceptor that converts snake_case/camelCase
TypeScript
157
star
2

co

Asynchronous cURL executor simply based on resource and Generator.
PHP
136
star
3

cowitter

Asynchronous Twitter client compatible with mpyw/co Generator-based flows.
PHP
116
star
4

eloquent-has-by-non-dependent-subquery

Convert has() and whereHas() constraints to non-dependent subqueries.
PHP
82
star
5

laravel-cached-database-stickiness

Guarantee database stickiness over the same user's consecutive requests
PHP
75
star
6

comphar

Pack all composer dependencies into a single phar file.
PHP
72
star
7

hub-purge

Clear GitHub image caches on README
Shell
35
star
8

FILTER_VALIDATE_EMAIL.js

TypeScript/JavaScript Email validation compatible with PHP's filter_var($value, FILTER_VALIDATE_EMAIL)
TypeScript
26
star
9

eloquent-has-by-join

Convert has() and whereHas() constraints to join() ones for single-result relations.
PHP
24
star
10

EasyCrypt

A class that provides simple interface for decryptable encryption.
PHP
23
star
11

laravel-local-class-scope

A tiny macro that reuse a global scope class as a local scope
PHP
23
star
12

aws-lambda-billing-slack-notification

Node.js 14 ไปฅ้™ๅ‘ใ‘ใฎ AWS ๅฝ“ๆœˆๅˆฉ็”จๆ–™้‡‘ Slack ้€š็Ÿฅใ‚นใ‚ฏใƒชใƒ—ใƒˆ
TypeScript
22
star
13

null-auth

Null Guard for Laravel. Designed for Middleware-based authentication and testing.
PHP
19
star
14

laravel-database-advisory-lock

Advisory Locking Features for Postgres/MySQL/MariaDB on Laravel
PHP
18
star
15

cloudwatch-front-logger

Save your browser console logs to AWS CloudWatch (Inspired by agea/console-cloud-watch)
TypeScript
17
star
16

phpunit-patch-serializable-comparison

Fixes assertSame()/assertEquals() serialization errors running in separate processes.
PHP
14
star
17

laravel-retry-on-duplicate-key

Automatically retry non-atomic upsert operation when unique key constraints are violated.
PHP
13
star
18

compoships-eager-limit

topclaudy/compoships + staudenmeir/eloquent-eager-limit
PHP
12
star
19

scoped-auth

Apply specific scope for user authentication.
PHP
10
star
20

laravel-mysql-system-variable-manager

A tiny extension of MySqlConnection that manages session system variables
PHP
9
star
21

twhelp

Twitter OAuth CLI Helper distributed by Golang cross-compilation.
Go
8
star
22

uuid-ulid-converter

UUID <=> ULID bidirectional converter
PHP
7
star
23

laravel-packages

Library packages list for Laravel
7
star
24

sqlc-restruct

Post-processor for kyleconroy/sqlc
Go
7
star
25

sharable-value-objects

Share value objects that contain the same primitive value as a singleton
PHP
5
star
26

sql-http-proxy

Go
5
star
27

exceper

Provides temporary error handler automatically using set_error_handler() and restore_error_handler().
PHP
5
star
28

laravel-database-mock

[Experimental] Database Mocking Library which mocks PDO underlying Laravel Connection classes
PHP
5
star
29

my-bookmarklet-collection

5
star
30

BaseUTF8

BaseXX encoder/decoder which support any valid UTF-8 sequences.
PHP
4
star
31

privator

Utils for testing private methods and properties on PHP 7.0+
PHP
3
star
32

noerr

Safe property reference chaining without errors
JavaScript
3
star
33

zenn

Zenn ใฎ่จ˜ไบ‹ไฟ็ฎกๅ ดๆ‰€
3
star
34

docker-clean

Remove all dangling images, volumes, networks and randomly named containers
Shell
2
star
35

mockery-pdo

[Experimental] BDD-style PDO Mocking Library for Mockery
PHP
2
star
36

streamable-console

Call interactive artisan command using arbitrary stream instead of STDIN.
PHP
2
star
37

laravel-pdo-emulation-control

Temporarily enable/disable PDO prepared statement emulation
PHP
2
star
38

mpyw

@mpyw's profile
2
star
39

most-similar

Search most similar word from stdin.
C
1
star
40

unique-violation-detector

Detect primary/unique key or constraint violation errors from PDOException.
PHP
1
star
41

amazon-vod-preset-convert-docker

Docker for https://github.com/aws-samples/amazon-vod-preset-convert
Dockerfile
1
star
42

laravel-unique-violation-detector

Detect primary/unique key or constraint violation errors from PDOException.
PHP
1
star
43

oh-my-zsh-lukerandall-extended

oh-my-zsh lukerandall theme which supports extended features
Shell
1
star
44

suve

Interact with AWS Secrets Manager and Parameter Store
Go
1
star
45

laravel-file-errors

A tiny extension that reports validation error details about uploaded files
PHP
1
star
46

FILTER_VALIDATE_EMAIL.html

HTML Pattern Attribute Validation compatible with PHP's filter_var() and mpyw/FILTER_VALIDATE_EMAIL.js
1
star