webman Documentation
repository·master·Indexed 25 days ago
https://github.com/walkor/webmanAn ultra-high-performance PHP framework built on the Workerman engine, optimized for high-concurrency networking tasks. Includes documentation on server configuration, application settings in config/app.php, and Docker Compose deployment.
What's inside webman
- webman is an ultra-high-performance PHP framework built on top of workerman. It is designed for high-concurrency applications and is licensed under the MIT license.
Access webman documentation and resources
masterYou can find official resources for webman at the following links:
- Home page: https://www.workerman.net/webman
- Official Documentation: https://webman.workerman.net
- Installation Guide: https://www.workerman.net/doc/webman/install.html
- Q&A / Support: https://www.workerman.net/questions
- App Marketplace: https://www.workerman.net/apps
Run Webman using Docker Compose
masterYou can run the Webman application in a Docker container using the provided
docker-compose.ymlconfiguration. This setup builds the image from the current directory, maps the local project files to the/appdirectory inside the container for live development, and exposes port8787.version: "3" services: webman: build: . container_name: docker-webman restart: unless-stopped volumes: - "./:/app" ports: - "8787:8787" command: ["php", "start.php", "start" ]Start the webman application
masterTo start the webman application, execute thestart.phpscript from your terminal. This script initializes the environment, loads the Composer autoloader, and invokes thesupport\App::run()method to launch the server.Configure application settings in config/app.php
masterThe
config/app.phpfile defines the core behavior of the webman application. You can modify these keys to control debugging, error reporting, timezones, and framework-level paths.Key configuration options include:
debug: Boolean to enable or disable debug mode.error_reporting: PHP error reporting level (e.g.,E_ALL).default_timezone: The default timezone for the application.request_class: The class used for handling requests (defaults tosupport\Request).public_path: The directory for public assets.runtime_path: The directory for runtime files/logs.controller_suffix: The suffix appended to controller class names (defaults toController).controller_reuse: Boolean determining if controller instances should be reused (defaults tofalse).
return [ 'debug' => true, 'error_reporting' => E_ALL, 'default_timezone' => 'Asia/Shanghai', 'request_class' => support\Request::class, 'public_path' => base_path() . DIRECTORY_SEPARATOR . 'public', 'runtime_path' => base_path(false) . DIRECTORY_SEPARATOR . 'runtime', 'controller_suffix' => 'Controller', 'controller_reuse' => false, ];Configure the webman server settings
masterThe
config/server.phpfile defines the core server behavior, including process management, file paths for PID and status, and logging. You can customize these settings to control how the server handles timeouts, package sizes, and where it writes its operational files.return [ 'event_loop' => '', 'stop_timeout' => 2, 'pid_file' => runtime_path() . '/webman.pid', 'status_file' => runtime_path() . '/webman.status', 'stdout_file' => runtime_path() . '/logs/stdout.log', 'log_file' => runtime_path() . '/logs/workerman.log', 'max_package_size' => 10 * 1024 * 1024 ];Reference server configuration keys
masterThe following configuration keys are available in
config/server.php:Key Description event_loopSpecifies the event loop implementation to use. Leave empty for default. stop_timeoutThe number of seconds to wait for processes to exit gracefully before forcing them to stop. pid_filePath to the file storing the process ID (PID) of the master process. status_filePath to the file storing the server status information. stdout_filePath to the file where standard output (stdout) is redirected. log_filePath to the main Workerman log file. max_package_sizeThe maximum size (in bytes) of a single data package allowed. Default is 10MB.