@aniya.jaskolski
To pass system environment variables to PHP in Apache, you can use the SetEnv
directive in your Apache configuration file.
1
|
SetEnv VARIABLE_NAME variable_value |
Replace VARIABLE_NAME
with the name of the environment variable you want to pass and variable_value
with the value you want to assign to it.
1
|
sudo service apache2 restart |
Now, you can access the environment variable in your PHP script using $_SERVER['VARIABLE_NAME']
.