Message-ID: <1537980500.2828.1485850923005.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2827_368189235.1485850923005" ------=_Part_2827_368189235.1485850923005 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Environments

Environments

=20
=20
=20
=20

Environment configuration as provided by Symfony is enhanced in eZ Platf= orm to allow specifying this in the virtual host configuration.
You can = configure several environments, from production, development or staging, ev= en if for each one of them you need to use different configuration sets.

 

Web server configuration

For example, using Apache, in the VirtualHost example in doc/apache2/ in your insta= ll, the required VirtualHost configurations have been already = included. You can switch to the desired environment by setting the EN= VIRONMENT environment variable to "prod", "dev" or other custom value, as you can see in the following example:

=20
# Environment.
# Possible values: "prod" and "dev" out-of-the-box, other values possible w=
ith proper configuration
# Defaults to "prod" if omitted (uses SetEnvIf so value can be used in rewr=
ite rules)
SetEnvIf Request_URI ".*" SYMFONY_ENV=3D"prod"
=20

Configuration

If you want to use a custom environment (something else then "prod= " and "dev") the next step is to create the dedicated c= onfiguration files for your environment:

  • app/config/config_ <env_name> .ym= l
  • app/config/ezplatform_ <env_name> .yml

The name used as <env_name> will be the one that can be used as value of the ENVIRONMENT environment variable.

Those files must import the main configuration file, just like the defau= lt  config_dev.yml already does. Here's an example:

=20
imports:
    - { resource: config.yml }
=20

 

This allows you to override settings defined in the main configuration f= ile, depending on your environment (like the DB settings or any other setti= ng you may want to override).

=20
=20
=20
=20

In this topic:

 

=20
=20
=20
------=_Part_2827_368189235.1485850923005--