Codeigniter PHP警告 [英] Codeigniter PHP Warning

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

问题描述

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

  PHP警告:include(application / errors / error_php.php ):无法打开流:在第167行上的/usr/src/dealvector/system/core/Exceptions.php中没有这样的文件或目录,referer:http:// localhost / dealcenter 

当我打开/usr/src/dealvector/system/core/Exceptions.php时,我在第167行得到如下:

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

APPPATH 的值为application / / p>

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



我该怎么办?请建议。我是新的代码点火器。

解决方案

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



我试图找出为什么cwd(当前工作目录)被重置,如果这是不同的较新版本的PHP,但不能找到任何有用的东西。



但是因为核心还是可以访问APPPATH,我只是改变了我的index.php文件中的行:

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

这应该可以让你的代码仍然可移植。


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/dealvector/system/core/Exceptions.php on line 167, referer: http://localhost/dealcenter

When I open the /usr/src/dealvector/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.

解决方案

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.

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

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