piyush
piyush

Reputation: 976

Codeigniter PHP Warning

Following error message is being logged in my codeigniter application :

PHP Warning:  include(application/errors/error_php.php): failed to open stream: No such file or directory in /usr/src/dv/system/core/Exceptions.php on line 167, referer: http://localhost/dc

When I open the /usr/src/dv/system/core/Exceptions.php I get following on line 167 :

include(APPPATH.'errors/error_php.php');

The value of APPPATH is application/

If I appent the absolute path, ie include('/usr/src/mypath'.APPPATH.'errors/error_php.php'); it is working fine.

What should I do about it ? Please suggest. I am new to code-igniter.

Upvotes: 4

Views: 18553

Answers (7)

Deepak
Deepak

Reputation: 1

I also got this error and reason is than I am using a view which was not exist, actually spelling mistake my controller where view is called

Upvotes: 0

Inoubli
Inoubli

Reputation: 374

In my case, I figured out that /application/errors folder is missing everything working fine after I copied an old errors folder

Upvotes: 0

Projenix
Projenix

Reputation: 147

I think that you have ran out of disk space on your root partition.

Upvotes: 0

Cody Helscel
Cody Helscel

Reputation: 57

For me it was because I accidentally moved the application/errors folder into a different folder (application/core) because I was too quick to click and drag the folder over. I use the NetBeans IDE.

Upvotes: 0

Shaun Forsyth
Shaun Forsyth

Reputation: 474

I was not happy with this answer, you should not have to change php.ini for this work.

I tried to find out why the cwd (current working directory) was being reset and if this was different in newer version of php, but couldn't find anything that was useful.

However since the core still had access to APPPATH I simply changed the line in my index.php file to

$application_folder = getcwd().'/../application';

This should allow your code to be transportable still.

Upvotes: 7

DampeS8N
DampeS8N

Reputation: 3621

In php.ini set the folder that application is in as an include_path.

Upvotes: 4

Ian Atkin
Ian Atkin

Reputation: 6346

This is not a Codeigniter problem at all. You don't have your include_path set up correctly in php.ini. Basically, the include_path gives PHP a number of different directories to look in when including files.

http://www.php.net/manual/en/ini.core.php#ini.include-path

Upvotes: 6

Related Questions