Configuration

Basic configuration file to run the application.

All important application settings are located inside .env file in the project root directory. This file is not bundled and you are required to create it. You can find template env_template in a root directory which you can rename to .env.

APP_ENV=dev # or prod for production
APP_DEBUG=1 # on production set to 0
APP_SECRET=YOUR_SECRET # your custom key https://randomkeygen.com/

DATABASE_URL=mysql://user:password@host:3306/db?charset=utf8mb4&serverVersion=mariadb-10.4.3
MAILER_URL=smtp://server:465?encryption=tls&auth_mode=login&username=USERNAME&password=PASSWORD

STRIPE_PUBLISHABLE_KEY=PUBLISHABLE_KEY
STRIPE_SECRET_KEY=SECRET_KEY

PAYPAL_EXPRESS_CHECKOUT_USERNAME=USERNAME
PAYPAL_EXPRESS_CHECKOUT_PASSWORD=PASSWORD
PAYPAL_EXPRESS_CHECKOUT_SIGNATURE=SIGNATURE
PAYPAL_EXPRESS_CHECKOUT_SANDBOX=true # set to false if you are on production

SENTRY_DSN=DSN # Key for https://sentry.io to catch exceptions

When configuring the the database connection you have to provide URI which consists from several parts. You can read about them in Doctrine's documentation. Application was tested with MariaDB and MySQL and everything was working without any issues. In the example above you can see more complex URI specifying a lot of options to showcase using MariaDB at the certain version. Sometimes it is important to specify exact version so the Doctrine will know how to run the queries against the DB because different DB versions supports miscellaneous features.

Last updated