PHP Codeigniter Warning

The following error message is 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 file /usr/src/dv/system/core/Exceptions.php, I follow line 167:

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

APPPATH value is application /

If I add an absolute path i.e. include('/usr/src/mypath'.APPPATH.'errors/error_php.php'); It works fine.

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

+4
source share
8 answers

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

I tried to find out why cwd (current working directory) was reset, and if it is different from the new php version, but did not find anything useful.

However, since the kernel still had access to APPPATH, I just changed the line in my index.php file to

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

This should allow your code to wrap more.

+7
source

This is not a Codeigniter problem at all. You do not have the correct include_path in php.ini. Basically, include_path gives PHP a number of different directories to look for when including files.

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

+6
source

In php.ini set the folder where the application is located as include_path.

+4
source

For me, this happened because I accidentally moved the application / error folder to another folder (application / kernel), because I clicked and dragged the folder too quickly. I am using NetBeans IDE.

0
source

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

0
source

In my case, I realized that the / application / errors folder is missing; everything works fine after I copied the old errors folder

0
source

I also got this error and the reason why I use a view that was not there is actually a spelling error of my controller, where the view is called

0
source

I got the same error on index.php and I solved it by changing

require_once(APPPATH.'system/core/CodeIgniter.php');

to

require_once('system/core/CodeIgniter.php');

0
source

Source: https://habr.com/ru/post/1413565/


All Articles