A project runs with docker, or with PHP on the host (see Quick start). For the Crest that runs up, down and install, see The global Crest and the project Crest.
With docker, use crest up, crest install and crest down (see The launcher). crest down stops and removes the containers. up --build rebuilds the image first, and down --volumes also removes the named volumes.
Without docker, crest serve starts PHP’s built-in web server for the project (see With PHP on the host). .htrouter.php is the router script of PHP’s built-in server. serve runs php -S 127.0.0.1:8080 -t public .htrouter.php in the project root. The router and the document root (public) are the same as in the container.
The port is --port, else APP_PORT from the environment, else APP_PORT in the project .env, else 8080. docker compose reads APP_PORT in the same order.
serve reads .env as docker compose does: the last APP_PORT line wins, and export, APP_PORT: <port>, quotes and # comments are allowed. serve does not expand ${...}: a value with ${...} stops serve with an error.
serve finds the project root from a subfolder. A global Crest passes serve to the Crest in vendor/, as it does the other project commands (see The global Crest and the project Crest). serve stops before PHP starts if .htrouter.php or <vendor-dir>/autoload.php is missing. vendor-dir is a setting of composer (see Configuration).
The server uses the PHP that runs Crest. PHP options on the command line, for example -d extension=phalcon.so, do not reach the server. Put such settings in php.ini.
Press Ctrl+C to stop the server. If the server continues to run, for example after Crest stopped in a different way, stop its PHP process. The command is the same in both flavors:
pkill -f -- '-S 127.0.0.1:8080'Use your port if it is not 8080.