i am using this code to define the directory paths of my project:
config.php is
<?php
define('CB_HOME', realpath(dirname(__DIR__)));
define('FD_HOME', CB_HOME."/testbot");
I use am using CB_home And FD_home in other files.
i am getting the error:
PHP Notice: Use of undefined constant CB_HOME - assumed 'CB_HOME' in C:\\xampp\\htdocs\\test-bot\\testbot\\bootstrap.php on line 3
PHP Warning: require_once(CB_HOME/AbstractCbRest.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in C:\\xampp\\htdocs\\test-bot\\testbot\\bootstrap.php on line 3
PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'CB_HOME/AbstractCbRest.php' (include_path='.;C:\\xampp\\php\\PEAR') in C:\\xampp\\htdocs\\test-bot\\testbot\\bootstrap.php on line 3
my bootstrap.php is :
<?php
require_once 'config.php';
require_once CB_HOME.'/AbstractCbRest.php';
where is it going wrong?
My guess is that include_path settings are interfering with your script. So (as mentioned by @deceze) you might be loading an incorrect (although existing) config.php file.
Maybe you could try using an absolute path to include your configuration or use something along the lines of: