Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CodeIgniter: failed to open stream: No such file or directory

i am having a

A PHP Error was encountered

Severity: Warning

Message: require_once(/../scraper_utilities.php): failed to open stream: No such file or directory

Filename: utility_classes/special_price_process.php

Line Number: 3

I only have just included a file scraper_utilities.php by this:

require_once('/../scraper_utilities.php');

Here is the file system of the codeigniter i am currently using:

enter image description here

EDIT: I Also tried

 require_once('../scraper_utilities.php');

And

require_once(__DIR__.'/scraper_ci/application/libraries/scraper_utilities.php');

but didn't also worked.

like image 464
Christian Burgos Avatar asked Sep 28 '22 16:09

Christian Burgos


2 Answers

i solved it by using APPPATH

require_once(APPPATH.'libraries/scraper_utilities.php');
like image 55
Christian Burgos Avatar answered Oct 01 '22 01:10

Christian Burgos


Remove that first / so:

require_once('../scraper_utilities.php');

../ will take you up one directory, the initial / takes you all the way up to the root directory

like image 42
James Taylor Avatar answered Oct 01 '22 01:10

James Taylor