Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Server Laravel Package

hyperf/server

Core server component for Hyperf, providing coroutine-driven HTTP and WebSocket server infrastructure built on Swoole and Swow. It handles connection management, request dispatching, lifecycle events, and graceful shutdown for high-performance PHP services.

Deep Wiki
Context7

hyperf/server is the core server component of the Hyperf framework, providing coroutine-based server abstractions built on Swoole and Swow. It powers HTTP, WebSocket, TCP, and UDP services while integrating with Hyperf’s DI container, annotations, middleware, routing, and event system.

  • Supports multiple server types: HTTP, WebSocket, TCP, and UDP
  • Configurable listeners, ports, protocols, and server settings
  • Middleware, routing, exception handling, and lifecycle events
  • Graceful reload/restart and process management
  • Seamless integration with Hyperf’s coroutine runtime and components
Frequently asked questions about Server
What is hyperf/server used for?
Hyperf/Server provides the core coroutine server abstraction for the Hyperf framework. It handles server lifecycle management, configuration, and transport primitives used by HTTP, WebSocket, and TCP components. Most applications use it indirectly through higher-level Hyperf packages rather than requiring it directly.
How do I install hyperf/server in a Laravel project?
You generally should not install hyperf/server in a Laravel project because it is built for the Hyperf framework, not Laravel. Composer can install the package, but it will not integrate with Laravel's HTTP kernel, service container, or routing. Laravel developers usually choose Laravel Octane, RoadRunner, or a dedicated Swoole integration instead.
Is hyperf/server compatible with Laravel?
No, hyperf/server is not a Laravel package and does not provide Laravel service providers, facades, or middleware integration. It is part of Hyperf and expects the Hyperf application lifecycle and coroutine runtime. It is not a drop-in replacement for Laravel's HTTP server stack.
Which PHP extensions does hyperf/server require?
Hyperf/Server runs on the Hyperf coroutine runtime, which uses Swoole or Swow. You need the matching PHP extension, such as ext-swoole or ext-swow, plus a PHP version supported by your Hyperf release. It does not run under the standard PHP-FPM request model.
How do I configure servers in hyperf/server?
Configuration is handled through Hyperf config files, typically config/autoload/server.php in a Hyperf application. You define server names, types, hosts, ports, and runtime settings there, and Hyperf/Server uses that configuration to manage the server lifecycle. The exact options depend on whether you use Swoole or Swow.
What is the difference between hyperf/server and hyperf/http-server?
Hyperf/Server provides the low-level coroutine server abstraction, lifecycle management, and transport primitives. Hyperf/HTTP-Server builds HTTP protocol handling on top of that foundation and is what most web applications require. Similar protocol packages exist for WebSocket and TCP services.
Can I use hyperf/server for WebSocket or TCP services?
Yes, Hyperf/Server supplies transport primitives used by HTTP, WebSocket, and TCP components. You configure the relevant server type and pair it with the appropriate protocol package or callbacks. Direct use requires familiarity with Hyperf's server configuration and event lifecycle.
How do I test a Hyperf server built on hyperf/server?
Test application logic with Hyperf's testing utilities and coroutine-aware test setup where available. For integration coverage, start the server in a controlled test environment and make real client requests against it. Keep protocol-specific tests in the higher-level component packages such as HTTP or WebSocket.
What are production concerns for hyperf/server?
Production deployments need the Swoole or Swow extension, a process supervisor, appropriate worker settings, structured logging, and graceful reload handling. Run the server behind a reverse proxy or load balancer for TLS termination and traffic management. Monitor memory usage and coroutine behavior, and follow Hyperf's deployment guidance.
What are alternatives to hyperf/server?
Alternatives include Laravel Octane with Swoole or RoadRunner, standalone RoadRunner, ReactPHP, AMPHP, and native Swoole servers. Hyperf/Server is the best fit when you are already building on Hyperf and want its coroutine lifecycle and transport abstractions. It is maintained as part of the Hyperf ecosystem, so version compatibility should follow your Hyperf release.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
vento/laravel-airbrake
wfeller/laravel-batch
maco-studios/mage-os-installer
busarm/armie
siberfx/laravel-logger
kfteam1991/dcat-admin
dashed/dashed-laposta
dashed/dashed-ecommerce-montaportal
dashed/dashed-ecommerce-etsy
neohq/string-blade-compiler
log1x/acf-composer
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager