Linux command
cli-wrapper 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Start a local development server
cli-wrapper serve
Serve on a specific port
cli-wrapper serve --port [8080]
Serve with a specific document root
cli-wrapper serve --docroot [public/]
Run with verbose output
cli-wrapper serve -v
Specify PHP binary
cli-wrapper serve --php [/usr/bin/php8.1]
说明
cli-wrapper is a command-line utility designed to simplify running PHP's built-in development server with proper configuration. It is commonly used with PHP frameworks and CMSs that require specific server routing rules. The tool wraps PHP's built-in server with sensible defaults and additional features for local development environments. It handles routing for applications that use front controllers, manages static file serving, and provides convenient options for common development scenarios. cli-wrapper is particularly useful when working with frameworks that need specific request routing, as it can configure the server to pass all requests through the application's entry point while still serving static assets directly.
参数
- serve
- Start the built-in PHP development server.
- --port _PORT_
- Port number for the server to listen on (default: 8000).
- --docroot _DIR_
- Document root directory for serving files.
- --php _PATH_
- Path to the PHP binary to use.
- -v, --verbose
- Enable verbose output for debugging.
- -h, --help
- Display help information.
FAQ
What is the cli-wrapper command used for?
cli-wrapper is a command-line utility designed to simplify running PHP's built-in development server with proper configuration. It is commonly used with PHP frameworks and CMSs that require specific server routing rules. The tool wraps PHP's built-in server with sensible defaults and additional features for local development environments. It handles routing for applications that use front controllers, manages static file serving, and provides convenient options for common development scenarios. cli-wrapper is particularly useful when working with frameworks that need specific request routing, as it can configure the server to pass all requests through the application's entry point while still serving static assets directly.
How do I run a basic cli-wrapper example?
Run `cli-wrapper serve` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does serve do in cli-wrapper?
Start the built-in PHP development server.