使用 SetEnv 设置的环境变量未传递给 PHP

使用 SetEnv 设置的环境变量未传递给 PHP

我正在设置一些环境变量以从 PHP $_SERVER 全局变量中获取,但它不起作用。变量不在 $_SERVER 中,也不在 phpinfo() 输出中。我已启用所有需要的模块,并尽我所能尝试了所有方法。我遗漏了什么?

这是我的虚拟主机:

<VirtualHost *:80>
ServerName     xpad.seinet.com.local    
ServerAlias    www.xpad.seinet.com.local  *.seinet.com.local www.*.seinet.com.local 

SetEnv SYMFONY__DATABASE__NAME__CLIENTE cliente
SetEnv SYMFONY__DATABASE__USER__CLIENTE cliente
SetEnv SYMFONY__DATABASE__PASSWORD__CLIENTE cliente

DocumentRoot   "/var/www/xpad-single/web"
    DirectoryIndex app.php

<Directory "/var/www/xpad-single/web">
    AllowOverride All
    Require all granted     
    Allow from All              
</Directory>

Alias /editions_files /publicationProcess3/INPUT_FILES/
<Directory "/publicationProcess3/INPUT_FILES/">
    AllowOverride All
    Require all granted
    Allow from All
</Directory>

ErrorLog /var/log/apache2/xpad-single_error.log
CustomLog /var/log/apache2/xpad-single_access.log combined

KeepAlive            On
MaxKeepAliveRequests 200
KeepAliveTimeout     5

AddOutputFilterByType DEFLATE text/css text/plain text/html     application/xhtml+xml text/xml application/xml

 <IfModule mod_headers.c>
        Header append Vary User-Agent env=!dont-vary

        ExpiresActive On
        ExpiresDefault "now plus 1 week"
        ExpiresByType image/x-icon "now plus 1 month"
        ExpiresByType image/gif    "now plus 1 month"
        ExpiresByType image/png    "now plus 1 month"
        ExpiresByType image/jpeg   "now plus 1 month"
    </IfModule>
<IfModule mod_expires.c>
        <Directory "/var/www/xpad-single/web/img/edicion_thumb">
            ExpiresActive On
            ExpiresDefault "access plus 1 month"
        </Directory>
</IfModule> 
</VirtualHost>

相关内容