PHPackages                             natanfelles/php-server - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. natanfelles/php-server

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

natanfelles/php-server
======================

Fine-tuning on the PHP built-in web server.

v2.12.1(1y ago)2811.9k↓16.7%22MITPHPPHP &gt;=5.6.0

Since Nov 27Pushed 1y ago3 watchersCompare

[ Source](https://github.com/natanfelles/php-server)[ Packagist](https://packagist.org/packages/natanfelles/php-server)[ Docs](https://github.com/natanfelles/php-server)[ RSS](/packages/natanfelles-php-server/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (20)Used By (2)

PHP Server
==========

[](#php-server)

[![Latest release](https://camo.githubusercontent.com/4f1fceb0916d94dbde4876e0e35d22b541a0ffd6157415b6b6b83cbc40883247/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6e6174616e66656c6c65732f7068702d7365727665722e7376673f636f6c6f72423d677265656e266c6162656c3d4c617465737425323072656c65617365267374796c653d706f706f7574)](https://github.com/natanfelles/php-server/releases)[![PHP version](https://camo.githubusercontent.com/4cc5f3184263c153b118a8787afc22dc9976bac2b85940dc48502f0981a76333/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6e6174616e66656c6c65732f7068702d7365727665722e7376673f636f6c6f72423d626c756576696f6c6574266c6162656c3d50485025323076657273696f6e267374796c653d666c6174)](https://php.net/downloads.php)[![Packagist downloads](https://camo.githubusercontent.com/44e47b7cc5227d063b62d96315f3adc83836bce6d757f6a3f73a99c57fa97695/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6174616e66656c6c65732f7068702d7365727665722e7376673f636f6c6f72423d253233663238643161266c6162656c3d5061636b6167697374253230646f776e6c6f616473267374796c653d666c6174)](https://packagist.org/packages/natanfelles/php-server)

Fine-tuning on the PHP built-in web server

[![PHP Built-in web server autoindex](https://camo.githubusercontent.com/643d18714923ec53f4b0e0ce82b70696580dc7a0fdf7ec137506f6f846559ffd/68747470733a2f2f692e696d6775722e636f6d2f64453742324c4a2e706e67)](https://camo.githubusercontent.com/643d18714923ec53f4b0e0ce82b70696580dc7a0fdf7ec137506f6f846559ffd/68747470733a2f2f692e696d6775722e636f6d2f64453742324c4a2e706e67)

> See release notes at:

Installation
------------

[](#installation)

### Composer

[](#composer)

Open your terminal and run:

```
composer global require natanfelles/php-server
```

Add the composer bin path to your *.bashrc*:

```
echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrc
```

Run:

```
source ~/.bashrc
```

### Manual

[](#manual)

Download and extract the *php-server* project folder.

Add the php-server alias to your *.bashrc*:

```
echo 'alias php-server="~/php-server/bin/php-server"' >> ~/.bashrc
```

Run:

```
source ~/.bashrc
```

Config
------

[](#config)

You can run the php-server in any folder of your operating system.

Each time you run the *php-server* command, it will look up if there is a file named *php-server.ini* in the current directory. If found, your settings will override the default settings.

A quick example file content is:

```
php = PHP_BINARY
host = localhost
port = 8080
root = ./public
autoindex = true
index = index.php
error_reporting = E_ALL

[ini]
display_errors = 1
display_startup_errors = 1
max_execution_time = 360
post_max_size = 200M
upload_max_filesize = 200M

[server]
ENVIRONMENT = development
```

> You can use the command `php-server new` to create a new configuration file in the current directory.

### Explanation

[](#explanation)

#### General Vars

[](#general-vars)

KeyDefault ValueDescriptionphp[PHP\_BINARY](http://php.net/manual/en/reserved.constants.php#constant.php-binary)PHP binary path or commandhostlocalhostServer hostport8080Server host portroot[getcwd()](http://php.net/manual/en/function.getcwd.php)Document root. The location that will be the public root of your website.autoindextrueDetermines if the server will list directory contents if it does not find an index file.indexindex.html index.phpThe names of the index files separated by spaces.error\_reporting[E\_ALL](http://php.net/manual/en/errorfunc.constants.php#errorfunc.constants.errorlevels.e-all)Sets the [level of errors](http://php.net/manual/en/function.error-reporting.php) that will be reported.#### Sections

[](#sections)

SectionDescriptioniniUsed to set custom [php.ini directives](http://php.net/manual/en/ini.list.php).serverUsed to set custom [Server and execution environment information](http://php.net/manual/en/reserved.variables.server.php).Knowing this, just create (if necessary) a php-server.ini file, run the server and you're done.

Run
---

[](#run)

As you can see in the [config](#config). You can create a php-server.ini file to leave the settings of each project already pre-established.

But, you can also simply run `php-server` and the server will already be available at .

The php-server command can receive some parameters and they are:

ParameterDescription--phpPHP binary path or command--hostServer host--portServer host port--rootDocument rootFor example, to run the server on a different port:

```
php-server --port 8081
```

Or, also with a different version of PHP than the default:

```
php-server --php php8.4 --port 8081
```

Right. You get the idea. If you want to run on a different host you can add the host to the [hosts file](https://en.wikipedia.org/wiki/Hosts_(file)) of your operating system.

Contribute
----------

[](#contribute)

Hello, how nice that you are reading this.

If you have any idea to improve this project or something is not working as it should, do not hesitate to open an [issue](https://github.com/natanfelles/php-server/issues) and if you have solved the problem feel free to open a [Pull Request](https://github.com/natanfelles/php-server/pulls).

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~141 days

Recently: every ~521 days

Total

19

Last Release

542d ago

Major Versions

v1.4 → v2.02017-11-27

PHP version history (2 changes)v1.0PHP &gt;=5.4.0

v2.7PHP &gt;=5.6.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3011423?v=4)[Natan Felles](/maintainers/natanfelles)[@natanfelles](https://github.com/natanfelles)

---

Top Contributors

[![natanfelles](https://avatars.githubusercontent.com/u/3011423?v=4)](https://github.com/natanfelles "natanfelles (102 commits)")

---

Tags

autoindexdocument-rootmod-rewritephpphp-devphp-developmentphp-iniphp-serverphp-webserverrewritedevDevtoolsserverdevelopmentrewritewebserverautoindexphp-serverdocument-rootmod-rewrite

### Embed Badge

![Health badge](/badges/natanfelles-php-server/health.svg)

```
[![Health](https://phpackages.com/badges/natanfelles-php-server/health.svg)](https://phpackages.com/packages/natanfelles-php-server)
```

###  Alternatives

[spatie/laravel-webhook-server

Send webhooks in Laravel apps

1.1k8.8M22](/packages/spatie-laravel-webhook-server)[felixfbecker/language-server-protocol

PHP classes for the Language Server Protocol

22476.7M6](/packages/felixfbecker-language-server-protocol)[clue/socket-raw

Simple and lightweight OOP wrapper for PHP's low-level sockets extension (ext-sockets).

35111.1M48](/packages/clue-socket-raw)[php-mcp/server

PHP SDK for building Model Context Protocol (MCP) servers - Create MCP tools, resources, and prompts

828280.5k25](/packages/php-mcp-server)[laminas/laminas-server

Create Reflection-based RPC servers

2423.1M23](/packages/laminas-laminas-server)[phpfastcgi/fastcgi-daemon

A FastCGI daemon written in PHP

33011.4k4](/packages/phpfastcgi-fastcgi-daemon)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
