Moodle 1.4.1 giving errors with PHP 5.0.2

Moodle 1.4.1 giving errors with PHP 5.0.2

by Martin Millmore -
Number of replies: 4

My service provider has just upgraded from PHP 4.something to 5.0.2, and moodle has stopped working. I have even tried a fresh install of moodle, but it still does not work. When I go to any page, I get a 500 error, and in the error log files, I see the following error;

Premature end of script headers: /home/millmore/public_html/test/index.php

Does anyone have any ideas of how to solve this?

Average of ratings: -
In reply to Martin Millmore

Re: Moodle 1.4.1 giving errors with PHP 5.0.2

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Any clues? Does anything work at all, or just a big nothing. Do you have any more specs on the host system. Was this error found in the Apache error_log file?
In reply to Howard Miller

Re: Moodle 1.4.1 giving errors with PHP 5.0.2

by Martin Millmore -

Nothing whatsoever from the Moodle install is working - the site is at;
http://legaltraining.millmoreweb.com/
so, the admin directory would be
http://legaltraining.millmoreweb.com/admin

Other php applications are working OK, e.g. Coppermine works fine. I did a completly clean install of moodle, and that did not work either, so I don't think its anything to do with edits I have done to my old version. The new version is at the following URL if that helps

http://www.millmoreweb.com/test

The system uses cPanel, so I don't have access to do everything, but I do believe that the error log is indeed the raw apache error log.  Here are a few more lines if it helps;

[Fri Oct 29 19:41:52 2004] [error] [client 80.132.175.76] File does not exist: /home/millmore/public_html/favicon.ico
[Fri Oct 29 19:30:05 2004] [error] [client 209.67.209.186] Premature end of script headers: /home/millmore/public_html/legaltraining/admin/cron.php
[Fri Oct 29 19:30:05 2004] [error] [client 209.67.209.186] Premature end of script headers: /home/millmore/public_html/test/admin/cron.php
[Fri Oct 29 19:24:31 2004] [error] [client 128.101.75.75] File does not exist: /home/millmore/public_html/favicon.ico
[Fri Oct 29 19:18:09 2004] [error] [client 213.103.125.99] File does not exist: /home/millmore/public_html/favicon.ico
[Fri Oct 29 19:00:05 2004] [error] [client 209.67.209.186] Premature end of script headers: /home/millmore/public_html/test/admin/cron.php

The only other clue I have is that I get a core dump file every time I get the Premature end of script headers error. I could zip it and upload it if you think it would help

I have also created a file to show the php setup too if that helps. It is at;

http://www.millmoreweb.com/phptest.php

The versions of the web modules are;

  Apache version 1.3.32 (Unix)  
  MySQL version 4.0.20-standard  
  PHP version 5.0.2  
  PERL version 5.8.3  
  Operating system Linux  
  Kernel version 2.4.22-1.2199.nptl  
  cPanel version 9.9.8-STABLE-6  

I hope this is enough to provide you with some clues, but if not then please let me know what other info I can provide, or what else I can test.

Thanks

Martin

In reply to Martin Millmore

Re: Moodle 1.4.1 giving errors with PHP 5.0.2

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I expect that you will be offered a version 4 options as soon as the complaints of broken code start to come in  smile
In reply to Marcus Green

Re: Moodle 1.4.1 giving errors with PHP 5.0.2

by Martin Millmore -

I have done a lot of debuging, and found a solution. I am sharing the solution here in case anyone else needs it in future.

I would also appreciate it if anyone could shed some light on why this works - it seems wrong to me, and I still wonder if my service provider has set up their system wrong.

The problem is with adodb. In the file lib/adodb/adodb.inc.php, there are the following lines;

 if (PHP_VERSION < 5) include_once(ADODB_DIR.'/adodb-php4.inc.php');
 else include_once(ADODB_DIR.'/adodb-iterator.inc.php');

I commented out these 2 lines, and replaced it with just the PHP4 import;

include_once(ADODB_DIR.'/adodb-php4.inc.php');

and it now works fine again.

What I don't understand is why it works on PHP5 with the PHP4 import, but not the PHP5 import. Does this mean that there is some problem inconsistency on the server, or does it just mean that adodb is not really compatible with PHP5? If it's the server one, I would like to be able to beat up my service provider about it smile