Before you begin, make sure you have the following installed on your system:
- PHP (version 7.4 or higher)
- Composer
- Symfony CLI
- MySQL or any other supported database management system
git clone https://github.com/your_username/symfony-fundamentals.git
cd symfony-fundamentals
composer install
Copy the .env
file and configure it according to your database credentials:
cp .env.dist .env
Edit the .env
file to set the database credentials:
# .env
DATABASE_URL=mysql://db_user:db_password@localhost:3306/db_name
symfony console doctrine:database:create
symfony console doctrine:migrations:migrate
If you want to populate the database with sample data:
symfony console doctrine:fixtures:load
symfony server:start
You should now be able to access your Symfony 6 Fundamentals project at http://127.0.0.1:8000
.
- To stop the Symfony server:
symfony server:stop
- To clear the cache:
symfony console cache:clear
- To update the database schema after making changes to your entities:
symfony console doctrine:schema:update --force
Congratulations! Your Symfony 6 Fundamentals project is now installed and ready to use. Happy coding!