#
ドキュメント

Document

自分のための備忘録です。

セットアップ

資料

フロー

1. Install Symfony CLI をインストール

$ curl -sS https://get.symfony.com/cli/installer | bash

$ symfony version
Symfony CLI version 5.11.0 (c) 2021-2025 Fabien Potencier (2025-02-17T09:11:09Z - stable)

ref. Download Symfony

2. 要件を確認

$ symfony check:requirements

Symfony Requirements Checker
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> PHP is using the following php.ini file:
/opt/homebrew/etc/php/8.3/php.ini

> Checking Symfony requirements:

.............................


 [OK]
 Your system is ready to run Symfony projects


Note  The command console can use a different php.ini file
~~~~  than the one used by your web server.
      Please check that both the console and the web server
      are using the same PHP version and configuration.

3. コンソールアプリケーションを作成

Composer を使用する方法と Symfony binary を使用する方法がある。 今回は Composer を使用する。

ref. Creating Symfony Applications

3.1 Composer をアップグレード

sudo composer self-update
Password:
You are running Composer as "root", while "/Users/foo/.composer" is owned by "foo"
Upgrading to version 2.8.6 (stable channel).

Use composer self-update --rollback to return to version 2.7.7

3.2 アプリケーションを作成

symfony new sample --version="7.2.x"
* Creating a new Symfony 7.2.x project with Composer
* Setting up the project under Git version control
  (running git init /Users/foo/workspace/github.com/sample)


 [OK] Your project is now ready in /Users/foo/workspace/github.com/sample