When doing includes inside includes it´s better to use absolute paths. So you can use the __DIR__
or __FILE__
constant to do it, just like this in test_file.php for example:
require_once(realpath(dirname(__FILE__) . '/../config.php'));
or just
require_once(realpath(__DIR__ . '/../config.php'));