cd
into the directory above where you want your project to live- Run:
composer create-project symfony/skeleton my-project
- Test your app at
http://localhost:8000/
. You should see the Symfony Welcome page. - Initialize a git repository by running
git init
- Open your
.gitignore
file and add.idea
to the bottom to ignore PhpStorm IDE files - Enable the Symfony plugin for this project:
- Go to Settings and search for Symfony
- Check the “Enable Plugin for this Project” checkbox
Make sure the Path to composer.json is set up:
- Go to Settings again and search for “composer”
- Make sure the “Path to composer.json:” is set as the one in the project directory
You should be ready to start coding at this point. A good place to start is in the config/routes.yaml
file
Additional Setup (optional)
- Set the web directory in preferences to
public
instead ofweb
. This will help with auto-complete in Twig. You’ll need to also install thesymfony/asset
package (see below).- Open Preferences in PhpStorm
- Search for symfony
- Change Web Directory to
public
Install the symfony/asset
package
composer require asset
Development Server
To start the built-in PHP development server, run:
./bin/console server:run