Symfony5をインストールする手順

Symfony5をインストールする手順

Symfony5をインストールする手順を記述してます。ここではOSにubuntuを利用してます。

環境

  • OS  ubuntu20.04
  • Symfony 5.1.2

composerを利用

composerを使ってインストールします。
※Ubuntu20.04にComposerをインストールする手順はこちら

composer create-project symfony/skeleton sf-project

※sf-projectは任意のプロジェクト名を指定

<出力結果>
Writing lock file
Generating optimized autoload files
27 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Symfony operations: 3 recipes (d910667423f5612ae5037ec9c3fe639a)
  - Configuring symfony/framework-bundle (>=5.1): From github.com/symfony/recipes:master
  - Configuring symfony/console (>=5.1): From github.com/symfony/recipes:master
  - Configuring symfony/routing (>=5.1): From github.com/symfony/recipes:master
Executing script cache:clear [OK]
Executing script assets:install public [OK]

Some files may have been created or updated to configure your new packages.
Please review, edit and commit them: these files are yours.

Some files may have been created or updated to configure your new packages.
Please review, edit and commit them: these files are yours.

              
 What's next? 
              

  * Run your application:
    1. Go to the project directory
    2. Create your code repository with the git init command
    3. Download the Symfony CLI at https://symfony.com/download to install a development web server

  * Read the documentation at https://symfony.com/doc

バージョン確認

./bin/console -V

<出力結果>
Symfony 5.1.2 (env: dev, debug: true)

Symfony5起動

下記のコマンドで起動します。
※5系では、まだ「composer require server」は利用できないようです。

php -S IPアドレス:8001 -t public

or

php -S localhost:8001 -t public

ブラウザから http://プライベートIP or サーバーアドレス or localhost:8001 にアクセスします。