CodeIgniter on 1and1错误报告 [英] CodeIgniter on 1and1 Error Reporting

查看:115
本文介绍了CodeIgniter on 1and1错误报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用CodeIgniter制作了一个网站,我目前用1and1托管它。在开发期间,一切看起来都很金。只要所有主机都与localhost一样可靠。



我希望从网站获取 PHP错误日志。不幸的是,1and1不分配对他们的Apache日志的访问。如何获取错误日志?



我尝试了什么?


  1. > 自定义错误记录功能

  2. 修改本地PHP.ini以允许/记录错误

  3. 使用php5添加必要的 AddHandler AddType 子句添加到我的 .htaccess



更新(10月1日)

仍在尝试解决我的问题,我已经把它缩小到PHP ActiveRecord spark。从PHP ActiveRecord继承的模型不会实例化。 PHP ActiveRecord的 ActiveRecord\Model 类被实例化。我使用以下代码片段执行此操作

  $ class_name =ActiveRecord\Model; 
echo in_array($ class_name,get_declared_classes());

返回 1 $ c> ActiveRecord \Model 和 0 用于 MyActiveRecordModel



据推测,ActiveRecord spark和和1and1之间存在一些摩擦 - 我的猜测,DB问题。这里有趣的部分。使用CodeIgniter提供的ActiveRecord库就像一个charm。我假设PHP ActiveRecord正在打印一些错误的错误。这是我想从1and1。



更新(10月8日)
如果我手动要求 MyActiveRecordModel 检查类声明定义的代码段 ActiveRecord\Model 未定义。

解决方案

此问题通过更改命名约定来解决。已将 MyActiveRecordModel 的文件命名为 myActiveRecordModel 。这不允许CodeIgniter自动加载所需的类。



我从将CodeIgniter 升级到版本3.0.0的步骤列表 - 尽管我使用的是版本2.1.3


I made a website with CodeIgniter and I am currently hosting it with 1and1. During development, everything looked golden. Only if all hosts were as reliable as localhost.

I am looking to get the PHP error logs from the site. Unfortunately, 1and1 does not allot access to their Apache logs. How can I get error logs? Debugging fatal errors is a pain without logs.

What I have tried?

  1. The custom error logging function
  2. Modifying the local PHP.ini to allow/log errors
  3. Used php5 by adding the necessary AddHandler and AddType clauses to my .htaccess

Still the problem is not fixed.

Update (October 1st)
Still trying to fix my issue, I have narrowed it down to the PHP ActiveRecord spark. The models which inherit from PHP ActiveRecord are not instantiated. PHP ActiveRecord's ActiveRecord\Model class is instantiated. I did this using the following snippet

    $class_name = "ActiveRecord\Model";
    echo in_array($class_name, get_declared_classes());

which returns a 1 for ActiveRecord\Model and 0 for MyActiveRecordModel.

Supposedly, there is some friction between the ActiveRecord spark and and 1and1—my guess, DB problems. Here comes the interesting part. Using the ActiveRecord library provided by CodeIgniter works like a charm. I presume PHP ActiveRecord is printing some errors of what is going wrong. This is what I want to get from 1and1.

Update (October 8th) If I manually require MyActiveRecordModel, the code snippet that checks for definition of classes claims ActiveRecord\Model is not defined.

解决方案

This issue is solved by changing the naming conventions. The file which had MyActiveRecordModel was named myActiveRecordModel. This did not allow CodeIgniter to autoload the required class.

I got this tip from a list of steps for upgrading CodeIgniter to version 3.0.0—although, I am on version 2.1.3

这篇关于CodeIgniter on 1and1错误报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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