Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Swoole\Http\ServerSwoole\Http\Server::start>
^Swoole\Http\ServerLast updated: Mon, 26 Oct 2026

Swoole\Http\Server::on

(PECL swoole >= 1.9.0)

Swoole\Http\Server::on — Bind callback function to HTTP server by event name.

Description

public function Swoole\Http\Server::on(string $event_name, callable $callback): void

Bind callback function to HTTP server by event name.

Parameters

event_name

callback

Return Values


<Swoole\Http\ServerSwoole\Http\Server::start>
^Swoole\Http\ServerLast updated: Mon, 26 Oct 2026