You should do this:
require_once( realpath(dirname(__FILE__) . '/Twitteroauth.php' ) );
Вопрос
In kohana 3.3 i need to include one of the controller file in the another controller
I used require_once( realpath(dirname(FILE) . '/Twitteroauth.php' ) );
Its showing the server error.
Thanks in advance.
Решение
You should do this:
require_once( realpath(dirname(__FILE__) . '/Twitteroauth.php' ) );
Другие советы
Function realpath
returns false
when file does not exist, so you should maybe check result before require
:
$path = realpath(dirname(__FILE__) . '/Twitteroauth.php' );
if(!empty($path))
require_once($path);
else
die("$path not found!");