Davo Smith mukaan.
When you write:
require_once('config.php');
Is the main 'config.php' file in the same folder as your PHP script, or do you actually mean to write:
require_once('../../config.php');
(as per existing examples in Moodle core).
You should also make sure you have debugging set to 'developer', if you haven't already done so (although, that won't help in this case, as you have to load the 'config.php' file correctly, before the debugging settings are initialised).