<p dir="auto">I'm running Symfony2 2.6.6, nginx 1.7.12 on linux/64.</p>
<p dir="auto">env VARS</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="SYMFONY__DATABASE__PASSWORD =&gt; &quot;testtesttest&quot;
SYMFONY__DATABASE__USER =&gt; &quot;root&quot;"><pre class="notranslate"><code class="notranslate">SYMFONY__DATABASE__PASSWORD =&gt; "testtesttest"
SYMFONY__DATABASE__USER =&gt; "root"
</code></pre></div>
<p dir="auto">have been set in shell &amp; nginx.</p>
<p dir="auto">As documented</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;How to Set external Parameters in the Service Container&quot;:
 http://symfony.com/doc/current/cookbook/configuration/external_parameters.html

    &quot;Now that you have declared an environment variable, it will be present in the PHP $_SERVER global variable. Symfony then automatically sets all $_SERVER variables prefixed with SYMFONY__ as parameters in the service container.

    You can now reference these parameters wherever you need them.&quot;"><pre class="notranslate"><code class="notranslate">"How to Set external Parameters in the Service Container":
 http://symfony.com/doc/current/cookbook/configuration/external_parameters.html

    "Now that you have declared an environment variable, it will be present in the PHP $_SERVER global variable. Symfony then automatically sets all $_SERVER variables prefixed with SYMFONY__ as parameters in the service container.

    You can now reference these parameters wherever you need them."
</code></pre></div>
<p dir="auto">Verifying,</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="php -i | grep SYMFONY__DATABASE
    SYMFONY__DATABASE__PASSWORD =&gt; &quot;testtesttest&quot;
    SYMFONY__DATABASE__USER =&gt; &quot;root&quot;
    _SERVER[&quot;SYMFONY__DATABASE__PASSWORD&quot;] =&gt; &quot;testtesttest&quot;
    _SERVER[&quot;SYMFONY__DATABASE__USER&quot;] =&gt; &quot;root&quot;"><pre class="notranslate"><code class="notranslate">php -i | grep SYMFONY__DATABASE
    SYMFONY__DATABASE__PASSWORD =&gt; "testtesttest"
    SYMFONY__DATABASE__USER =&gt; "root"
    _SERVER["SYMFONY__DATABASE__PASSWORD"] =&gt; "testtesttest"
    _SERVER["SYMFONY__DATABASE__USER"] =&gt; "root"
</code></pre></div>
<p dir="auto">setting symfony parameters</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cat ./app/config/parameters.yml
    parameters:
        database_driver:   pdo_mysql
        database_host:     127.0.0.1
        database_port:     3306
        database_name:     test_01
        database_user:     &quot;%database.user%&quot;
        database_password: &quot;%database.password%&quot;
        mailer_transport:  smtp
        mailer_host:       ~
        mailer_user:       &quot;%mailer.user%&quot;
        mailer_password:   &quot;%mailer.password%&quot;
        locale:            en
        secret:            xxxx"><pre class="notranslate"><code class="notranslate">cat ./app/config/parameters.yml
    parameters:
        database_driver:   pdo_mysql
        database_host:     127.0.0.1
        database_port:     3306
        database_name:     test_01
        database_user:     "%database.user%"
        database_password: "%database.password%"
        mailer_transport:  smtp
        mailer_host:       ~
        mailer_user:       "%mailer.user%"
        mailer_password:   "%mailer.password%"
        locale:            en
        secret:            xxxx
</code></pre></div>
<p dir="auto">symfony "at shell" should inherit the ENV-defined values</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="user &lt;= &quot;%database_user%&quot; &lt;= &quot;%database.user%&quot; &lt;= SYMFONY__DATABASE__USER &lt;= &quot;root&quot;
password &lt;= &quot;%database_password%&quot; &lt;= &quot;%database.password%&quot; &lt;= SYMFONY__DATABASE__PASSWORD &lt;= &quot;testtesttest&quot;"><pre class="notranslate"><code class="notranslate">user &lt;= "%database_user%" &lt;= "%database.user%" &lt;= SYMFONY__DATABASE__USER &lt;= "root"
password &lt;= "%database_password%" &lt;= "%database.password%" &lt;= SYMFONY__DATABASE__PASSWORD &lt;= "testtesttest"
</code></pre></div>
<p dir="auto">from site root, DB create with doctrine fails with "connection refused"</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="php app/console doctrine:database:create
    Could not create database for connection named `test_01`
    SQLSTATE[HY000] [2002] Connection refused"><pre class="notranslate"><code class="notranslate">php app/console doctrine:database:create
    Could not create database for connection named `test_01`
    SQLSTATE[HY000] [2002] Connection refused
</code></pre></div>
<p dir="auto">From shell, with mysql tools, there's no problem</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="mysqladmin -u root -p create test_01
    Enter password: 
    =&gt; &quot;testtesttest&quot;

mysqladmin -u root -p 
    ...
    +------------------------------+
    |          Databases           |
    +------------------------------+
    ...
    | test_01                      |
    +------------------------------+"><pre class="notranslate"><code class="notranslate">mysqladmin -u root -p create test_01
    Enter password: 
    =&gt; "testtesttest"

mysqladmin -u root -p 
    ...
    +------------------------------+
    |          Databases           |
    +------------------------------+
    ...
    | test_01                      |
    +------------------------------+
</code></pre></div>
<p dir="auto">Also, editing</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="./app/config/parameters.yml
    ...
-       database_user:     &quot;%database.user%&quot;
-       database_password: &quot;%database.password%&quot;
+       database_user:     root
+       database_password: &quot;testtesttest&quot;
    ..."><pre class="notranslate"><code class="notranslate">./app/config/parameters.yml
    ...
-       database_user:     "%database.user%"
-       database_password: "%database.password%"
+       database_user:     root
+       database_password: "testtesttest"
    ...
</code></pre></div>
<p dir="auto">All doctrine cmds, e.g.,</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="php app/console doctrine:database:drop --force
php app/console doctrine:database:create
php app/console doctrine:schema:create"><pre class="notranslate"><code class="notranslate">php app/console doctrine:database:drop --force
php app/console doctrine:database:create
php app/console doctrine:schema:create
</code></pre></div>
<p dir="auto">now work without error</p>
<p dir="auto">I think that in order to provide a better user experience, we should improve the error messages shipped with the Form component by default. I am <strong>not</strong> talking about the error messages in the Validator component.</p>
<p dir="auto">If I use the Validator component stand-alone, getting an error such as "This value is not a valid number" is fine. If I use the Form component, displaying that message for a form field is a bit awkward. Even worse are the tons of "This value is invalid" messages.</p>
<p dir="auto">I suggest to</p>
<ol dir="auto">
<li>Set sensible defaults for the "invalid_message" options in all core types. These defaults should be user friendly, such as "Please enter a valid email address." (or better, if you have suggestions)</li>
<li>Duplicate the error messages of the Validator component into the Form component and change the translations to be more user friendly (in the web form context, again, such as "Please enter a valid number" or better). This will mean a bit more maintenance work, but much better UX.</li>
</ol>
<p dir="auto">Opinions? How would you ideally like the error messages to be when you submit an erroneous field?</p>