Codeigniter PHP 警告 [英] Codeigniter PHP Warning

查看:26
本文介绍了Codeigniter PHP 警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下错误消息记录在我的 codeigniter 应用程序中:

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

当我打开/usr/src/dv/system/core/Exceptions.php 时,我在第 167 行得到以下信息:

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

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

APPPATH 的值为 application/

The value of APPPATH is application/

如果我附加绝对路径,即 include('/usr/src/mypath'.APPPATH.'errors/error_php.php'); 它工作正常.

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

我该怎么办?请建议.我是 code-igniter 的新手.

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

推荐答案

我对这个答案不满意,你不应该为这项工作更改 php.ini.

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

我试图找出为什么要重置 cwd(当前工作目录)以及这在较新版本的 php 中是否有所不同,但找不到任何有用的东西.

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.

但是由于核心仍然可以访问 APPPATH 我只是将 index.php 文件中的行更改为

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.

这篇关于Codeigniter PHP 警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆