Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change way to get environment variable #25

Merged
merged 1 commit into from
Mar 14, 2024
Merged

change way to get environment variable #25

merged 1 commit into from
Mar 14, 2024

Commits on Feb 27, 2024

  1. change way to get environment variable

    By default, on debian the configuration /etc/php/XX/apache2/php.ini indicates :
    
    ; This directive determines which super global arrays are registered when PHP
    ; starts up. G,P,C,E & S are abbreviations for the following respective super
    ; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty
    ; paid for the registration of these arrays and because ENV is not as commonly
    ; used as the others, ENV is not recommended on productions servers. You
    ; can still get access to the environment variables through getenv() should you
    ; need to.
    ; Default Value: "EGPCS"
    ; Development Value: "GPCS"
    ; Production Value: "GPCS";
    ; https://php.net/variables-order
    variables_order = "GPCS"
    
    This means that the global environment variables are not passed to php with production value.
    
    Using php function getenv, this permits to use SetEnv instruction in apache2 virtualhost configuration without changing php configuration.
    
    The mecanism is the same with php_fpm (common usage with nginx).
    mduret committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    5eec149 View commit details
    Browse the repository at this point in the history