I suggest you ...

Application Environment for application specific secrets

Currently to pass application specifics secrets (DB_URL, API_KEYs, etc) the only options are to store them with your code (not best practice) or to edit the Application Settings / PHP Settings and manually configure them using php-fpm flag:

env[KEY] = VALUE

An interface such as Application Environment next/in to Application Settings which lists sets of 2 inputs (KEY, VALUE) which then generates an environment specific php.ini to be loaded by php-fpm will make it much easier for customers to configure these variables

9 votes
Sign in
Password icon
Signed in as (Sign out)

We’ll send you updates on this idea

Alex shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →


Sign in
Password icon
Signed in as (Sign out)
  • Juan Alvarez commented  ·   ·  Flag as inappropriate

    I've tried adding ;env[foo] = bar to PHP FPM settings but I get the following error:

    One or more directive are not supported. Please choose from php_flag, php_admin_flag, php_value and php_admin_value.

  • Greg Martyn commented  ·   ·  Flag as inappropriate

    What's missing for us is the ability to set vars that Apache sees. I'd like to be able to do this in our .htaccess:
    RewriteRule ^ %{ENV:APP_URL}%{REQUEST_URI} [last,redirect=301]

    Without the ability to use variables, we need a separate .htaccess for each environment

  • Alex commented  ·   ·  Flag as inappropriate

    Thank you for your response.

    Actually after making this suggestion I ran into an more granular issue.
    If one uses the PHP Settings section to configure those values - they will be only available to the PHP-FPM pool, but not to command line execution from cron jobs or manual.

    To get around this would be to have the php.ini settings file stored somewhere in the application file structure so one can pass it to the php executable via -c option

    As to how much value it provides to users. I think truly it only provides an ease of access, but not an overall improvement.

  • AdminCloudways (Admin, Cloudways) commented  ·   ·  Flag as inappropriate

    Hi Alex:

    Thank you for your post.

    As you rightly point out, this functionality is available and possible through the PHP Settings feature provided on the Platform. Have you faced any issues with getting it to work with environment variables?

    By providing a new section, I see users having the following advantage:

    a) A consolidated view of custom defined PHP env variables and their values.
    b) Instead of users typing "env[VAR_NAME] = VAR_VALUE", they will be typing "VAR_NAME = VAR_VALUE" in the new section.

    I agree that it will bring some ease to users and provide a slightly cleaner alternative that what is available right now. However, I am trying to determine if, as a user, you will find that it will really provide value to users, since what this new section will achieve can already be achieved through the PHP Settings section?


    Cloudways Team

Feedback and Knowledge Base