PHPackages                             phphleb/webrotor - 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. [Framework](/categories/framework)
4. /
5. phphleb/webrotor

ActiveProject[Framework](/categories/framework)

phphleb/webrotor
================

Asynchronous PHP web server for shared hosting

v1.2.2(5mo ago)631.5k71MITPHPPHP &gt;=7.2.0CI passing

Since Jan 10Pushed 5mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (5)Versions (20)Used By (1)

[![License: MIT](https://camo.githubusercontent.com/6a971da90180ef445bacc481bafedda8784051a6eb20d93284bfc4c53d748aa9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542532302846726565292d3331433735342e737667)](https://github.com/phphleb/hleb/blob/master/LICENSE)[![version](https://camo.githubusercontent.com/cd97c1a686099bebdf7b58191bae513367d2620d2764e19f4fc9d93665627f85/68747470733a2f2f706f7365722e707567782e6f72672f706870686c65622f776562726f746f722f76)](https://packagist.org/packages/phphleb/webrotor)[![Total Downloads](https://camo.githubusercontent.com/03e2c81416361134346a026cb0a28beab92ee3cb3db01a31c9dca8069ac75410/68747470733a2f2f706f7365722e707567782e6f72672f706870686c65622f776562726f746f722f646f776e6c6f616473)](https://packagist.org/packages/phphleb/webrotor)[![PHP](https://camo.githubusercontent.com/d0a73a70cac6e07fb720c4c6f907c7da2c49ca5cf14fdbfe485582b2ca326fcb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545372e322d626c7565)](https://camo.githubusercontent.com/d0a73a70cac6e07fb720c4c6f907c7da2c49ca5cf14fdbfe485582b2ca326fcb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545372e322d626c7565)[![PHP](https://camo.githubusercontent.com/5e499a8b3a08ba57ec0640d128fa33eb8929b78cf02d347df3a93947089cfa1f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382d626c7565)](https://camo.githubusercontent.com/5e499a8b3a08ba57ec0640d128fa33eb8929b78cf02d347df3a93947089cfa1f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382d626c7565)[![build](https://github.com/phphleb/webrotor/actions/workflows/build.yml/badge.svg?event=push)](https://github.com/phphleb/webrotor/actions/workflows/build.yml)

WebRotor
=========

[](#webrotor)

 [![WebRotor Logo](https://raw.githubusercontent.com/phphleb/webrotor/be4645b38e31123a2eceb82556ac331af4b76aa5/webrotor-300x300-logo.png)](https://raw.githubusercontent.com/phphleb/webrotor/be4645b38e31123a2eceb82556ac331af4b76aa5/webrotor-300x300-logo.png)

A web server designed to enable asynchronous request processing for shared hosting.

Supports PHP versions 7.2 and higher.

Overview
--------

[](#overview)

Shared hosting environments often come with significant limitations compared to dedicated servers.
However, those limitations shouldn't stop you from experimenting with multi-threaded and asynchronous servers!

**WebRotor** is a specialized web server designed for asynchronous request handling on shared hosting. It is easy to install and configure.
*Important:* Before using, make sure to review the requirements for your code to execute asynchronously. Most frameworks include guidelines and recommendations for enabling asynchronous functionality.

With this library, applications built on frameworks like `Laravel`, `Symfony`, `Yii3` and others that support asynchronous processing, along with any other asynchronously written code, can operate in this mode on various shared hosting platforms.

*It makes sense to move a project to asynchrony if it has performance problems or you want to experiment with asynchrony.*

---

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

[](#installation)

Use [Composer](https://getcomposer.org/):

```
composer require phphleb/webrotor --no-dev
```

Next, you need to install one of the PHP HTTP client implementations for PSR-7.

[Nyholm](https://github.com/Nyholm/psr7):

```
composer require nyholm/psr7
```

```
composer require nyholm/psr7-server
```

or [Guzzle](https://github.com/guzzle/guzzle/):

```
 composer require guzzlehttp/guzzle
```

Shared Hosting
--------------

[](#shared-hosting)

### Modifying the Index File

[](#modifying-the-index-file)

Typically, shared hosting environments have a public folder containing an index file, usually named `index.php`.
It is necessary to modify this file so that your application's code is enclosed within an asynchronous loop. You can find examples of how to connect to an asynchronous server in the documentation for the framework you are using.
In a simplified manner, this looks like:

```
