Run on another port

← All configuration scenarios

You have a development app on port 8080 and want a second server for testing. This profile starts Mini4Work on port 9000 with one worker. The default loopback address keeps the listener local to your machine.

Choose the port

In the application with mini4work/webserver installed, save this as local.json beside vendor/.

JSON
{
  "listen": { "port": 9000 },
  "workers": { "count": 1 }
}
Shell
php vendor/mini4work/webserver/examples/server.php local.json

Check the listener

Shell
curl -i http://127.0.0.1:9000/hello

Expect HTTP 200 and a JSON response containing "path": "/hello". Repeated requests show the same worker_pid until that worker rotates. If the port is occupied, choose another free port in the profile and use it in the request.

If clients connect from outside the container, see listener addresses.