Skip to content

Installation ​

Requirements ​

  • PHP 8.3 or later within PHP 8.x (^8.3)
  • Composer
  • A PSR-7 and PSR-17 implementation, such as nyholm/psr7
  • A container that implements Solo\Contracts\Container\WritableContainerInterface, such as solophp/container
  • An HTTP emitter that implements Solo\Contracts\Http\EmitterInterface, such as solophp/http-emitter, if you send responses with run()

Projects on PHP 8.2 can stay on version 3.x.

Composer ​

Install Solo Application 4:

bash
composer require "solophp/application:^4.0.1"

solophp/router 4 comes with it: Application builds the router itself. These pages document version 4.0.1; when upgrading an existing application, follow the upgrade guide.

4.0.0, published on 17 October 2026, is an earlier state of this release: it takes a solophp/router 3.5 router from the container through RouterInterface and supports PHP 8.2. The ^4.0.1 constraint keeps Composer from picking it, for example on PHP 8.2 or next to solophp/router 3.

Then add the packages the application runs on. The quick start uses these:

bash
composer require solophp/container solophp/http-emitter nyholm/psr7 nyholm/psr7-server
PackagePurpose
solophp/containerThe container Application creates when you do not pass one
solophp/http-emitterSends the response to the client in run()
nyholm/psr7PSR-7 messages and PSR-17 factories
nyholm/psr7-serverCreates the server request from PHP globals

solophp/container 3 requires PHP 8.4. On PHP 8.3 Composer installs version 2, which Application uses the same way.

Without solophp/container, pass your own container to the constructor; otherwise it throws RuntimeException. See Custom Container.

Dependencies ​

DependencyPurpose
psr/containerContainer interface
psr/http-messageHTTP messages
psr/http-server-handlerRequest handler
psr/http-server-middlewareMiddleware
psr/http-factoryResponse factory
solophp/contracts (^1.1)WritableContainerInterface, EmitterInterface
solophp/router (^4.0)Route definitions, compiled matching, route cache

The router contracts of solophp/contracts are not used: Application works with Solo\Router\Router directly.

Next steps ​

Released under the MIT License.