I have an Apache 2.4 proxying to PHP7.4.4 php-fpm and I am trying to hide or unset the $_SERVER['LD_LIBRARY_PATH'] variable.
How do I change or get rid of this variable $_SERVER['LD_LIBRARY_PATH'] in the PHP output?
Assume that apache2.4 is installed to /apache24.
==userX-fpm-pool.conf==
[userX]
user = userX
group = userX
listen = 127.0.0.1:9003
clear_env = yes
env['LD_LIBRARY_PATH'] = /fakepath
==php.ini==
variables_order = "GPCS"
==userX-vhost.conf==
<VirtualHost *:80>
ServerName userX.xxxxxx.com
ServerAdmin webmaster@localhost
DocumentRoot /userX/home/www
UnsetEnv LD_LIBRARY_PATH
<Directory /userX/home/www>
Options Indexes FollowSymLinks
DirectoryIndex index.php index.html
Require all granted
AllowOverride All
</Directory>
ProxyPassMatch "^/(.*\.php(/.*)?)$" "fcgi://127.0.0.1:9003/"
</VirtualHost>
==index.php==
<?php
print_r($_ENV);
print_r($_SERVER);
The curl output:
curl -H "Host: userX.xxxxxx.com" http://127.0.0.1
Array
(
)
Array
(
[LD_LIBRARY_PATH] => /apache24/lib --> How do I change or get rid of this variable?
[USER] => userX
[HOME] => /home
[SCRIPT_NAME] => /index.php
[REQUEST_URI] => /
[QUERY_STRING] =>
[REQUEST_METHOD] => GET
[SERVER_PROTOCOL] => HTTP/1.1
[GATEWAY_INTERFACE] => CGI/1.1
[REMOTE_PORT] => 49248
[SCRIPT_FILENAME] => //index.php
[SERVER_ADMIN] => webmaster@localhost
[CONTEXT_DOCUMENT_ROOT] => /userX/home/www
[CONTEXT_PREFIX] =>
[REQUEST_SCHEME] => http
[DOCUMENT_ROOT] => /userX/home/www
[REMOTE_ADDR] => 127.0.0.1
[SERVER_PORT] => 80
[SERVER_ADDR] => 127.0.0.1
[SERVER_NAME] => userX.xxxxxx.com
[SERVER_SOFTWARE] => Apache/2.4.43 (Unix) OpenSSL/1.1.1 PHP/7.4.4
[SERVER_SIGNATURE] =>
[PATH] => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
[HTTP_ACCEPT] => */*
[HTTP_USER_AGENT] => curl/7.58.0
[HTTP_HOST] => userX.xxxxxx.com
[FCGI_ROLE] => RESPONDER
[PHP_SELF] => /index.php
[REQUEST_TIME_FLOAT] => 1587830093.9565
[REQUEST_TIME] => 1587830093
)