How can I make a config.php file with all environment variables and import it successfully into other scripts?
config.php:
<?php
$folder = 'SomePath';
?>
script1.php
<?php
require_once('config.php');
function doStuff(){
global $folder;
echo($folder);
}
doStuff();
?>
I get
PHP Notice: Undefined variable: folder in script1.php
It's php version 5.4.41
and I can't do anything about it (no root)