{"id":1656,"date":"2022-08-30T15:18:21","date_gmt":"2022-08-30T15:18:21","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/27\/require-once-generates-errors-in-kohana-v3-3-1-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:18:21","modified_gmt":"2022-08-30T15:18:21","slug":"require-once-generates-errors-in-kohana-v3-3-1-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/require-once-generates-errors-in-kohana-v3-3-1-collection-of-common-programming-errors\/","title":{"rendered":"Require Once Generates Errors in Kohana v3.3.1-Collection of common programming errors"},"content":{"rendered":"<p>How do I <code>require_once<\/code> in my controller, a third party class that I put in <code>kohana\\vendor\\twitter-api-php<\/code>? I tried this answer which was similar but I kept getting errors (see below). My project&#8217;s file structure is as follows:<\/p>\n<pre><code>kohana\n- application\n- modules\n- system\n- vendor\n<\/code><\/pre>\n<p>I keep getting these errors<\/p>\n<pre><code> Warning: Uncaught exception 'ErrorException' with message 'require_once(C:\\wamp\\www\\kohana): failed to open stream: Permission denied' in C:\\wamp\\www\\kohana\\application\\classes\\Controller\\Twitter.php:8 Stack trace: #0 C:\\wamp\\www\\kohana\\application\\classes\\Controller\\Twitter.php(8): Kohana_Core::error_handler(2, 'require_once(C:...', 'C:\\wamp\\www\\koh...', 8, Array) #1 C:\\wamp\\www\\kohana\\application\\classes\\Controller\\Twitter.php(8): Controller_Twitter::before() #2 C:\\wamp\\www\\kohana\\system\\classes\\Kohana\\Controller.php(69): Controller_Twitter-&gt;before() #3 [internal function]: Kohana_Controller-&gt;execute() #4 C:\\wamp\\www\\kohana\\system\\classes\\Kohana\\Request\\Client\\Internal.php(97): ReflectionMethod-&gt;invoke(Object(Controller_Twitter)) #5 C:\\wamp\\www\\kohana\\system\\classes\\Kohana\\Request\\Client.php(114): Kohana_Request_Client_Internal-&gt;execute_request(Object(Request), Object(Response)) #6 C:\\wamp\\www\\kohana\\system\\classes\\Kohana\\Request.php(986): Kohana_Request_Client-&gt;execute(Object(Request)) #7 C:\\wamp\\www\\kohana\\index.p in C:\\wamp\\www\\kohana\\application\\classes\\Controller\\Twitter.php on line 8\n<\/code><\/pre>\n<p>and this error<\/p>\n<pre><code>Fatal error: Controller_Twitter::before(): Failed opening required '' (include_path='.;C:\\php\\pear') in C:\\wamp\\www\\kohana\\application\\classes\\Controller\\Twitter.php on line 8\n<\/code><\/pre>\n<p>Here is my code<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-27 12:25:22. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>How do I require_once in my controller, a third party class that I put in kohana\\vendor\\twitter-api-php? I tried this answer which was similar but I kept getting errors (see below). My project&#8217;s file structure is as follows: kohana &#8211; application &#8211; modules &#8211; system &#8211; vendor I keep getting these errors Warning: Uncaught exception &#8216;ErrorException&#8217; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1656","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1656","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1656"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1656\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1656"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1656"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}