I need to define an environment variable called SQLANY17 , and this variable must be available in PHP (i.e. in the "Environment" section of the standard phpinfo() page). PHP runs through FastCGI and I am running CentOS 7 x64, Apache 2.4.6, and PHP 5.5.30.
I edited /etc/httpd/conf.d/fcgid.conf , which already exists in my distribution. According to the documentation, the environment can be defined using FcgidInitialEnv.
<IfModule mod_fcgid.c>
However, this does not work even after a complete restart of the computer. Any ideas? I am sure that fcgid.conf correctly, because entering some random characters prevents the restart of the Apache server.

In my setup, Nginx proxy requests for Apache This is nginx.conf for the example.com host:
server { listen 192.168.1.131:80; server_name example.com; server_name www.example.com; server_name ipv4.example.com; client_max_body_size 128m; root "/var/www/vhosts/example.com/httpdocs"; access_log "/var/www/vhosts/system/example.com/logs/proxy_access_log"; error_log "/var/www/vhosts/system/example.com/logs/proxy_error_log"; if ($host ~* ^www.example.com$) { rewrite ^(.*)$ http://example.com$1 permanent; } location / { proxy_pass http://192.168.1.131:7080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Accel-Internal /internal-nginx-static-location; access_log off; } }
And this is httpd.conf for the same host:
<VirtualHost 192.168.1.131:7080 > ServerName "example.com:80" ServerAlias "www.example.com" ServerAlias "ipv4.example.com" ServerAdmin " administrator@example.com " UseCanonicalName Off DocumentRoot "/var/www/vhosts/example.com/httpdocs" CustomLog /var/www/vhosts/system/example.com/logs/access_log ErrorLog "/var/www/vhosts/system/example.com/logs/error_log" <IfModule mod_suexec.c> SuexecUserGroup "example" "psacln" </IfModule> <IfModule mod_fcgid.c> FcgidInitialEnv PP_CUSTOM_PHP_INI /var/www/vhosts/system/example.com/etc/php.ini FcgidInitialEnv PP_CUSTOM_PHP_CGI_INDEX plesk-php55-fastcgi FcgidMaxRequestLen 134217728 </IfModule> <Directory /var/www/vhosts/example.com/httpdocs> <IfModule mod_fcgid.c> <Files ~ (\.php$)> SetHandler fcgid-script FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .php Options +ExecCGI </Files> </IfModule> Options -Includes -ExecCGI </Directory> <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^www.example.com$ [NC] RewriteRule ^(.*)$ http://example.com$1 [L,R=301] </IfModule> </VirtualHost>
php environment-variables apache cgi fastcgi
gremo
source share