← 返回命令列表

Linux command

symfony 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Create new project

symfony new [project_name]

Create web app

symfony new [project_name] --webapp

Start development server

symfony server:start

Stop server

symfony server:stop

Show server status

symfony server:status

Open in browser

symfony open:local

Run console command

symfony console [command]

Check security

symfony check:security

说明

symfony is the official command-line tool for managing Symfony PHP framework projects. It provides project scaffolding, a built-in local development server with PHP support, and wrappers for common Symfony console commands. Project creation offers templates ranging from minimal microservice skeletons to full web applications with pre-configured bundles. The local development server includes automatic HTTPS via locally-trusted certificates, PHP version management, and Docker service integration for databases and other dependencies. The console wrapper executes Symfony console commands (cache clearing, database migrations, route listing) with automatic environment detection. Security checking scans project dependencies against known vulnerability databases and recommends updates.

参数

new _NAME_
Create project.
server:start
Start local server.
server:stop
Stop server.
server:status
Show status of the local server.
server:log
Show logs from the local web server and PHP-FPM.
console _CMD_
Run Symfony console (wrapped bin/console).
open:local
Open local project URL in browser.
check:security
Check for known vulnerabilities in composer.lock dependencies.
local:php:list
List installed PHP versions.
--webapp
Scaffold full web app template (Twig, Doctrine, security, etc.).
--version _VER_
Install a specific Symfony version (e.g. lts, 6.4, 7.1).
-d, --daemon
Run the local server in the background.
--allow-http
Disable HTTPS on the local server.

FAQ

What is the symfony command used for?

symfony is the official command-line tool for managing Symfony PHP framework projects. It provides project scaffolding, a built-in local development server with PHP support, and wrappers for common Symfony console commands. Project creation offers templates ranging from minimal microservice skeletons to full web applications with pre-configured bundles. The local development server includes automatic HTTPS via locally-trusted certificates, PHP version management, and Docker service integration for databases and other dependencies. The console wrapper executes Symfony console commands (cache clearing, database migrations, route listing) with automatic environment detection. Security checking scans project dependencies against known vulnerability databases and recommends updates.

How do I run a basic symfony example?

Run `symfony new [project_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does new _NAME_ do in symfony?

Create project.