Este SO Q & A parece responder à sua pergunta
You want to use auto_prepend_file. Set this directive in your php.ini or .htaccess file to the path to your
config.phpfile and any PHP file accessed will automatically have the contents of the config file prepended to it.For
.htaccess:php_value auto_prepend_file /full/path/to/file/config.phpKeep in mind this ONLY will work on a server where PHP is run as an Apache module. If PHP is run as a CGI you need to add edit it in your
php.inifile or put it inside a.user.inifile just without thephp_valuepart.In
Nginxyou could add this line to server configuration insidelocation ~ \.php$fastcgi_param PHP_VALUE "auto_prepend_file=/full/path/to/file/config.php";