1

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.

Igbanam
  • 5,904
  • 5
  • 44
  • 68
  • It might help you http://stackoverflow.com/questions/3209807/how-to-do-error-logging-in-php-codeigniter – M Khalid Junaid Sep 29 '13 at 08:58
  • 1
    have you defined the error log file path in config file?! – mamdouh alramadan Sep 29 '13 at 09:37
  • @mamdouhalramadan which of the configuration files do you refer to? The configuration file for CodeIgniter is properly setup and CodeIgniter runtime information is being logged. What I cannot get to are the PHP error logs – Igbanam Sep 29 '13 at 16:42
  • @dianuj no it cannot. How do I get PHP error logs is what I asj – Igbanam Sep 29 '13 at 16:43
  • Writing a custom error handler should help you, but it seems that it doesn't? You should tell us (in your question!) what you tried exactly, what happened etc. – Nanne Sep 30 '13 at 05:09
  • I have written a custom error message reporter but it's incapable of bringing me the errors I need. – Igbanam Oct 01 '13 at 20:02
  • @Nanne I just updated the question. Take a look (: – Igbanam Oct 01 '13 at 20:23

1 Answers1

0

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

Igbanam
  • 5,904
  • 5
  • 44
  • 68