layout: docs-server title: Swoole Server reload permalink: /docs/modules/swoole-server-reload

public boolean Swoole\Server::reload ( void )

Alias: swoole_server->reload()

Gracefully restart all the worker processes and reload the PHP files.

Parameter
Return

The result if it has been reloaded successfully

Example

Restart all the worker processes by signal

kill -USR1 MASTER_PID

Only restart the task processes by signal

kill -USR2 MASTER_PID

Get all the files loaded before the worker started

<?php
$server->on('WorkerStart', function($serv, $workerId) {
    var_dump(get_included_files());
});

When using APC/OpCache