adodb.inc.php error msg - and Can't Log In

adodb.inc.php error msg - and Can't Log In

by paul rayner -
Number of replies: 76

Tried to log into my moodle this morning, and the following error was displayed:

Notice: Only variable references should be returned by reference in /drive2/fpgshttpd/basil/mooodle/lib/adodb/adodb.inc.php on line 2548

It prevents me from logging into moodle at all - can anyone make any suggestions for me please??

Average of ratings: -
In reply to paul rayner

Re: adodb.inc.php error msg - and Can't Log In

by Rob Johnson -
Paul - I woke up today to the same problem on two sites (same host, but different accounts). I finally logged into my hosting account to find this message:


PHP Upgraded to 4.4.0 Date Posted: July 14, 2005

PHP on all UNIX web servers affecting ALL php using web sites is now version 4.4.0.

From the PHP website: This is a maintenance release that addresses a serious memory corruption problem within PHP concerning references. If references were used in a wrong way, PHP would often create memory corruptions which would not always surface and be visible.

Details concerning this release are available at http://www.php.net/release_4_4_0.php

PHP is a scripting language used to drive dynamic web sites and web applications. If you use PHP for any aspect of your web site, we recommend that you immediately confirm the operation of your scripts. You may have to consult with your PHP developer or package supplier to correct any inconsistencies introduced by this new PHP version.

If you do not use PHP on your web site, then your site is NOT affected by this upgrade.



This may identify the source of the problem, but to fix it, I have no idea.
In reply to Rob Johnson

Re: adodb.inc.php error msg - and Can't Log In

by Ralph Putnam -
I'm having same problem with my moodle server--hosting service is Omnis Network.  Can anyone help??
In reply to Ralph Putnam

Re: adodb.inc.php error msg - and Can't Log In

by Rob Johnson -
Ralph - I use Omnis as well.  Other than a couple of minor issues, I was very satisfied with them...until today.
In reply to Rob Johnson

Re: adodb.inc.php error msg - and Can't Log In

by paul rayner -

Thanks for any suggestions. Logged in much later, and the problem had disappeared.

Would be nice to know what caused it.

Cheers

In reply to paul rayner

Re: adodb.inc.php error msg - and Can't Log In

by Ralph Putnam -
Problem persists on Omni servers--any suggestions appreciated.
In reply to Ralph Putnam

Re: adodb.inc.php error msg - and Can't Log In

by Martin Dougiamas -
Core developersನ ಚಿತ್ರ Documentation writersನ ಚಿತ್ರ Moodle HQನ ಚಿತ್ರ Particularly helpful Moodlersನ ಚಿತ್ರ Plugin developersನ ಚಿತ್ರ Testersನ ಚಿತ್ರ
Can you get them to just switch off the notices?   Things might be working fine anyway, and there's no need to print notices to the browser.
In reply to Martin Dougiamas

Re: adodb.inc.php error msg - and Can't Log In

by Scott Grogg -
Martin... our site too is now experiencing the problems noted by others.  I asked our hosting service to turn off the PHP notices and it still choked and would not let us through to the site.  black eye  Our host refuses to roll back the PHP to a previous version at this time.  Any new ideas?
In reply to paul rayner

Re: adodb.inc.php error msg - and Can't Log In

by Sharon Peters -
Hi guys,

You're not alone. I'm with Powweb as my server and returned from vacation today to discover that my moodle homepage opens with:

Notice: Only variable references should be returned by reference in /www/m/mtlpetersnet/htdocs/moodle/moodle/lib/adodb/adodb.inc.php on line 2689

After reading your posts I checked with Powweb and, sure enough, Powweb had posted this in their community:

PHP 4.4.0 Released

[11-Jul-2005] The PHP Development Team would like to announce the immediate release of PHP 4.4.0. This is a maintenance release that addresses a serious memory corruption problem within PHP concerning references. If references were used in a wrong way, PHP would often create memory corruptions which would not always surface and be visible. The increased middle digit was required because the fix that corrected the problem with references changed PHP's internal API. PHP 4.4.0 does not have any new features, and is solely a bugfix release.

So, anyone out there with a fix-it for this problem?

Thanks,
Sharon Peters
In reply to paul rayner

Re: adodb.inc.php error msg - and Can't Log In

by Rob Johnson -
Sharon - Thank you for the reply. I would like to hear from anyone that has Moodle working with php 4.4.0.
In reply to Rob Johnson

Re: adodb.inc.php error msg - and Can't Log In

by Sharon Peters -
Last night, after posting in this forum, I went to the online chat with my server provider powweb, where they are usually very helpful. I was immediately told to upgrade to moodle's newest version. So I checked, and yup, the newest version was released last week on July 8 (while I was on vacation).

So I downloaded and installed the new version.

However, it has *not* cleared up the problem at all. I still have the error msg -

Notice: Only variable references should be returned by reference in /www/m/mtlpetersnet/htdocs/moodle/moodle/lib/adodb/adodb.inc.php on line 2689

H
owever, I thought I would mention it anyways, just in case it might help anyone else.

Still looking for a solution...

Sharon Peters
In reply to Sharon Peters

Re: adodb.inc.php error msg - and Can't Log In

by Petr Skoda -
Core developersನ ಚಿತ್ರ Documentation writersನ ಚಿತ್ರ Peer reviewersನ ಚಿತ್ರ Plugin developersನ ಚಿತ್ರ
I am evaluating the problem just now...

4.4.0 is not fully backwards compatible, I am not surprised that something does not work. They would call it 4.3.12 if they did not expect problems wink
In reply to Petr Skoda

Re: adodb.inc.php error msg - and Can't Log In

by Martin Dougiamas -
Core developersನ ಚಿತ್ರ Documentation writersನ ಚಿತ್ರ Moodle HQನ ಚಿತ್ರ Particularly helpful Moodlersನ ಚಿತ್ರ Plugin developersನ ಚಿತ್ರ Testersನ ಚಿತ್ರ
Thanks Petr, today was the first I heard of PHP 4.4.0 , let alone problems with it...

Can people having problems please get the latest ADOdb library from here and use it to totally replace the moodle/lib/adodb directory you have in your Moodle. See if that helps and get back to us ASAP.
In reply to Martin Dougiamas

Re: adodb.inc.php error msg - and Can't Log In

by Petr Skoda -
Core developersನ ಚಿತ್ರ Documentation writersನ ಚಿತ್ರ Peer reviewersನ ಚಿತ್ರ Plugin developersನ ಚಿತ್ರ
I have upgraded my Windows and Gentoo boxes to 4.4.0 and everything seems to work fine. Anyway I have tried to upgrade to latest Adodb 4.64 and again both seem to work OK.

I suppose we should test the new Adodb on as much servers as possible and later it could go into 1.5.3.

There might be problems in other libraries related to 4.4.0 - please report them here on moodle.org.


skodak
In reply to Petr Skoda

Re: adodb.inc.php error msg - and Can't Log In

by Rob Johnson -
I have tried Adodb 4.64, and the problem persists sadHere is a link to my site (Moodle 1.5.1).  Even if notices were turned off, the site does not let me log in.  It loops back to the login screen, and in FF, it says I do not have cookies enabled (I do).

Thanks for the help.

Rob
In reply to Rob Johnson

Re: adodb.inc.php error msg - and Can't Log In

by Petr Skoda -
Core developersನ ಚಿತ್ರ Documentation writersನ ಚಿತ್ರ Peer reviewersನ ಚಿತ್ರ Plugin developersನ ಚಿತ್ರ
I am using plain default Gentoo installation on one of my boxes too and it works fine. Problem must be somewhere in your PHP/Apache configuration sad
In reply to Petr Skoda

Re: adodb.inc.php error msg - and Can't Log In

by Rob Johnson -
Petr - You have me convinced that it is a server setting.  I have taken out a support ticket, and have yet to hear back.  For good measure, I tried Moodle 1.5.2 just to see.  The error persists.  Thank you for looking into the problem.

Rob
In reply to Rob Johnson

Re: adodb.inc.php error msg - and Can't Log In

by Ralph Putnam -
Rob, too bad!  I also tried adodb 4.64 and got no improvement.  Others, thanks for your help--any more ideas?

Ralph
In reply to Martin Dougiamas

Re: adodb.inc.php error msg - and Can't Log In

by Sharon Peters -
Sorry to get back to y'all so much later. I am at a conference in Memphis and been very busy....

Just updated my adodb library as suggested and it still doesn't work; but I see that many others are experiencing the same frustration.

Any potential solutions yet?

Sharon Peters
In reply to Sharon Peters

Re: adodb.inc.php error msg - and Can't Log In

by Stacey Heron -

Im having the same issues!!! I am with powweb.. Anyone found a solution?

HELP!!

Stacey

In reply to Stacey Heron

Re: adodb.inc.php error msg - and Can't Log In

by Sharon Peters -
Hi Stacey,

I first experienced this problem after Powweb updated their php to 4.4 - did you notice the same thing?

Have you spoken with anyone in the Powweb chat room support? Please do and ask if they have any solutions. I went in last week looking for help, but they suggested it was a developer's problem....

Let me know how it goes....

Sharon Peters
In reply to Sharon Peters

Re: adodb.inc.php error msg - and Can't Log In

by Stacey Heron -

Hi Sharon,

Finally fixed.. first you need to download the latest ADOdb library from here. Then open up the adodb.inc.php file. 

The error is around line 2660 of the 4.6.4 (most recent version) of the adodb system.  Look for the following section:

Change this line: 

function &GetAssoc($force_array = false $first2cols = false)

To this:

function GetAssoc($force_array = false $first2cols = false )

A big thanks to Scott Grogg for this fix.. You're a life saver!!!

Stacey

In reply to Stacey Heron

Re: adodb.inc.php error msg - and Can't Log In

by Scott Grogg -
Stacey and everyone... glad that I could help with finding the fix to this issue.  After extensive testing on multiple servers, I've experienced no problems.  Just keep me informed if you find anything!
In reply to Stacey Heron

Re: adodb.inc.php error msg - and Can't Log In

by Sharon Peters -
Thanks Stacey and Scott,

Fixed the problem with your solution.

I noticed as of just several minutes ago that there is a new version of  ADOdb - 4.6.5.

I downloaded and installed it, but alas, the fix was not in it, so one will still have to change the code as you described.

Thanks for all the collaborative efforts to get this little bug solved. Moodle at its best!

Sharon
In reply to Stacey Heron

Re: adodb.inc.php error msg - and Can't Log In

by Steve Graham -
This fix worked for me!  Thanks Stacy!
In reply to Steve Graham

Re: adodb.inc.php error msg - and Can't Log In

by Julian Whitehead -
Have now done both fixes and all the errors have gone - HURRAY!
Thanks chaps
In reply to Julian Whitehead

Re: adodb.inc.php error msg - and Can't Log In

by Julian Whitehead -
Whoops, spoke too soon, still getting the error in CPanel error log.
sad
In reply to Rob Johnson

Re: adodb.inc.php error msg - and Can't Log In

by Sean Hayford O'Leary -

I've been using PowWeb and have experienced this error as well.

Technically, it works, but even after upgrading, I still receive the error message: "Notice: Only variable references should be returned by reference in [...]/member/htdocs/lib/adodb/adodb.inc.php on line 2689"

In reply to Sean Hayford O'Leary

Re: adodb.inc.php error msg - and Can't Log In

by Scott Grogg -

Sean,

I noticed the same problem when making an upgrade on one of our servers with Moodle 1.5 today.  But, after going in and making the small revision to the adodb.inc.php page, it repaired the issue.  I would suggest going in and looking at the page for the line I indicated and making the revision.

Scott

In reply to Rob Johnson

Re: adodb.inc.php error msg - and Can't Log In

by Forrest Nelson -

Rob, I am using Moodle 1.4 on Powweb. Powweb just updated last week to PHP 4.4.0 like many providers have. The next time I logged on to my moodle site, I was able to get on, but I also have the variable reference line 2598 error message and now all my student profile pictures are broken. There is no X or ?mark in the broken picture links. Other than that, Moodle 1.4 works with the new version of PHP.

Forrest Nelson

www.forrestworld.org/moodle

In reply to paul rayner

Re: adodb.inc.php error msg - and Can't Log In

by Scott Grogg -
Has anyone found a solution to this issue yet?????
In reply to paul rayner

FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Scott Grogg -

Please be advised that you can fix this issue by making this revision to the adodb.inc.php file.  The error is around line 2660 of the 4.6.4 (most recent version) of the adodb system.  Look for the following section:

Change this line:  function &GetAssoc($force_array = false $first2cols = false  TO THIS:),

function GetAssoc($force_array = false $first2cols = false ),

This change will fix the entire issue!

Scott Grogg
Warner Southern College

/**
* return whole recordset as a 2-dimensional associative array if there are more than 2 columns.
* The first column is treated as the key and is not included in the array.
* If there is only 2 columns, it will return a 1 dimensional array of key-value pairs unless
* $force_array == true.
*
* @param [force_array] has only meaning if we have 2 data columns. If false, a 1 dimensional
* array is returned, otherwise a 2 dimensional array is returned. If this sounds confusing,
* read the source.
*
* @param [first2cols] means if there are more than 2 cols, ignore the remaining cols and
* instead of returning array[col0] => array(remaining cols), return array[col0] => col1
*
* @return an associative array indexed by the first column of the array,
* or false if the data has less than 2 cols.
*/

function &GetAssoc($force_array= false $first2cols = false ),
In reply to Scott Grogg

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Martin Dougiamas -
Core developersನ ಚಿತ್ರ Documentation writersನ ಚಿತ್ರ Moodle HQನ ಚಿತ್ರ Particularly helpful Moodlersನ ಚಿತ್ರ Plugin developersನ ಚಿತ್ರ Testersನ ಚಿತ್ರ
Can you contact the ADOdb project and let them know?  I'll add ADOdb 4.65 to Moodle CVS.
In reply to Martin Dougiamas

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Scott Grogg -

Martin,

I've contacted John Lim and the ADOdb project about the fix.  Hopefully, they will get it implemented quickly. 

Please note:  I've tried this fix on seven different servers with the PHP 4.4.0 upgrade and it has repaired all of them.

Scott

In reply to Scott Grogg

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Martin Dougiamas -
Core developersನ ಚಿತ್ರ Documentation writersನ ಚಿತ್ರ Moodle HQನ ಚಿತ್ರ Particularly helpful Moodlersನ ಚಿತ್ರ Plugin developersನ ಚಿತ್ರ Testersನ ಚಿತ್ರ
Thanks, Scott!!    approve

John Lim was quick! Can someone verify for me that ADOdb 4.65 works out of the box with Moodle on PHP 4.4.0 ? If it works fine I'll add the new ADOdb to Moodle 1.5.3 and get that out straight away.
In reply to Martin Dougiamas

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Seth Mayo -
I just downloaded ADOdb 4.65 and it still doesn't work without the fix.  However, the fix is working great!

-Seth
In reply to Martin Dougiamas

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Sean S -
I just upgraded a client to 1.5.2 with the latest daily build and I'm still getting this error. There seems to be a number of different solutions. Is there a definitive fix for this?

Yes the client is using powweb.
In reply to Scott Grogg

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Rob Johnson -
Scott - The fix worked for me.  Thanks so much.

Rob
In reply to Scott Grogg

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Stacey Heron -

All fixed.. thanks so much!!

Stacey big grin

In reply to Scott Grogg

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Arturo Campos -

Thanks the fix also worked for us.

http://undl.edu.mx/moodle

We are also hosted at Powweb.......

Saludos!    Greetings from Ensenada, Baja, Mexico.

Arturo Campos

In reply to Scott Grogg

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Riaan Ras -
All fixed.. thanks so much!!
Riaan Ras
In reply to Riaan Ras

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Julian Whitehead -
That was a very scary fix, the one above did not work for me, the following did though:

function GetAssoc($force_array = false, $first2cols = false )

Rather than:

function &GetAssoc($force_array = false, $first2cols = false )

All hell broke loose when I put the comma after the closing bracket like this:

function GetAssoc($force_array = false $first2cols = false ),

All fixed now though - PHEW!

Cheers Jools
In reply to Julian Whitehead

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by James Nimmo -
Thanks Julian, that worked perfectly!

function GetAssoc($force_array = false, $first2cols = false )

In reply to Scott Grogg

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Brian Roy -
 I d/l'd the most recent ADOdb files and unzipped, changed the formula mentioned and ftp'd to my Moodle site. I've deleted the blank lines in the other files mentioned (with a text editor). But, I get the same error messages.


===========================
Notice: Only variable references should be returned by reference in /home/bconsult/public_html/moodle/lib/adodb/adodb.inc.php on line 2749

Warning: Cannot modify header information - headers already sent by (output started at /home/bconsult/public_html/moodle/lib/adodb/adodb.inc.php:2749) in /home/bconsult/public_html/moodle/lib/setup.php on line 238

Warning: Cannot modify header information - headers already sent by (output started at /home/bconsult/public_html/moodle/lib/adodb/adodb.inc.php:2749) in /home/bconsult/public_html/moodle/lib/moodlelib.php on line 2118

Warning: Cannot modify header information - headers already sent by (output started at /home/bconsult/public_html/moodle/lib/adodb/adodb.inc.php:2749) in /home/bconsult/public_html/moodle/lib/moodlelib.php on line 2119
===============
Thanks
In reply to Scott Grogg

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Jeff Bean -

No luck here. Our hosting provider upgraded to PHP 4.4 today and promptly broke our moodle. I read this thread attentively and did the following:

  1. Downloaded adodb 4.65
  2. Edited adodb.inc.php
    1. There was some ambiguity over which of the two GetAssoc functions to change. So I changed the first one, that didn't work, I undid the change and then changed the second one. That didn't work either.
    2. I also tried the fix Eloy mentioned to return the reference rather than the entire result array. That didn't work either.

So now I'm out of ideas. I'm a developer but am not that familiar with PHP, and I don't have any more time to mess with this today. My wife, the teacher, is unhappy that her moodle is out of commission and she can't login prepare for the new school year. Help!

Average of ratings: Useful (1)
In reply to Scott Grogg

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Derek Gaudet -

YAY!

I was in a panic when I began preapring for a teacher's workshop where I was going to show my staff how to use Moodle to enhance their classroom work. I found this forum and yes indeed my probelm was solved.

You just have to love open source!
Thanks for the great advice.

Derek

In reply to paul rayner

Re: adodb.inc.php error msg - and Can't Log In

by Nicole Snyder -
Hello Everyone,

I tried this fix and it did not work for me. After downloading the new adob I changed the code in adobe.inc.php in Moodle 1.5.1 I then get the following error:

Parse error: parse error, unexpected T_VARIABLE, expecting ')' in /home/mysite/public_html/moodle/lib/adodb/adodb.inc.php on line 2676

Please Help,
Nicole
In reply to Nicole Snyder

Re: adodb.inc.php error msg - and Can't Log In

by Scott Grogg -
Nicole,

I have found that the new ADOdb version (4.65) breaks Moodle 1.4 and 1.5 in multiple ways, including the error message you identified.  The best thing that you  could do is revert back to the ADOdb found within the Moodle installation (may require a download of Moodle again) and then apply the fix.  It should work through the issues.

Should you need additional help, feel free to e-mail me at groggs@warner.edu or call 863-638-7249. 

Scott
In reply to Scott Grogg

Re: adodb.inc.php error msg - and Can't Log In

by Martin Dougiamas -
Core developersನ ಚಿತ್ರ Documentation writersನ ಚಿತ್ರ Moodle HQನ ಚಿತ್ರ Particularly helpful Moodlersನ ಚಿತ್ರ Plugin developersನ ಚಿತ್ರ Testersನ ಚಿತ್ರ
Please everyone, keep testing with Scott's fix and reporting results.

Change this line in moodle/lib/adodb/adodb.inc.php by removing the &:

function &GetAssoc($sql, $inputarr=false,$force_array = false, $first2cols = false)

to this:

function GetAssoc($sql, $inputarr=false,$force_array = false, $first2cols = false)

When reporting, let us know the PHP version you are using, and also let us know the version of ADOdb you have modified - you'll find this at the top of the same file. The one in Moodle currently is ADOdb 4.60.

Moodle uses the return value of that function within essential functions in lib/datalib.php, so changing the return type as that fix does could affect some things. ie the fix may seem to fix some things under PHP 4.4.0, but it could also be breaking other Moodle code.

Until I can be more sure I can't add this fix to the distribution.
In reply to Martin Dougiamas

Re: adodb.inc.php error msg - and Can't Log In

by Eloy Lafuente (stronk7) -
Core developersನ ಚಿತ್ರ Documentation writersನ ಚಿತ್ರ Moodle HQನ ಚಿತ್ರ Peer reviewersನ ಚಿತ್ರ Plugin developersನ ಚಿತ್ರ Testersನ ಚಿತ್ರ
Hi,

first of all, I must drop a BIG ALARM here! Inside moodle/lib/adodb/adodb.inc.php there are TWO GetAssoc() functions! Looking at code, they are:
function &GetAssoc($sql, $inputarr=false,$force_array = false, $first2cols = false)
and:
function &GetAssoc($force_array = false, $first2cols = false)
And, if I'm not wrong you are "mixing them" in this discussion, perhaps causing some troubles!

After reading a bit about the problem (in PHP bugs and some info from jonlim's blog, it seems that, under PHP 4.4 and PHP 5.1 (and above), results of a function can be returned by reference only if they are references.

Coming back to both functions above, the first one is a method under the ADOConnection class and the second one is a method under the ADORecordSet class.

The first one seems to properly return a reference to an array (see the line before the return), so it shouldn't be a problem.

But the second one returns just directly an array and that's exactly the "forbidden fruit" under PHP 4.4.0 and up! So the function to be patched is exactly
function &GetAssoc($force_array = false, $first2cols = false)
Anyway, perhaps it could be better to, instead of changing the declaration of the function from reference to value, causing copies of really BIG (result sets!) objects to be created all the time (and causing some potential problems if such objects have to be modified in other scopes) to change the function a bit in order to make it returns references instead of values.

To do so, I suggest this change, just modify the:
return $results;
line at the end of the function above to:
$refresults =& $results;
return $refresults;
Doing this we have created a pointer (reference) to the $results array and such reference will be returned by the function (accomplishing PHP 4.4.0 new laws).

IMPORTANT WARNING: My suggested change hasn't been tested at all (because I haven't found any 4.4.0 version for my Mac) and it's 100% hypothetical (looking the code it could cause other problems like "pointers to pointers"...) so, my personal recommendations are:

- For MOODLERS: Use the simpler change from:
function GetAssoc($force_array = false, $first2cols = false)
to
function GetAssoc($force_array = false, $first2cols = false)
- For DEVELOPERS: Analyse my suggested change, perhaps it's the correct way, perhaps no. Only one idea...

Ciao smile

PD: I hope I'm not doing things more and more confusing, and that the function to change is the one I've showed you here. I apologises for not being able to test it! sad Any feedback (patch applied, OS, PHP and Moodle versions) will be absolutely welcome, of course! cool


In reply to Eloy Lafuente (stronk7)

Re: adodb.inc.php error msg - and Can't Log In

by Scott Grogg -
Eloy,

We have tried your suggested fix on multiple servers (Moodle 1.4.4, 1.4.5, and 1.5.2) (PHP 4.4.0) over the past two days without any luck.  We have continued to receive similar reference errors, or lock outs of the system. 

Has anybody else tried the possible solution Eloy supplied???  What were the results???

Scott
In reply to Eloy Lafuente (stronk7)

Re: adodb.inc.php error msg - and Can't Log In

by Chris Mawson -

Hi Eloy.

I tried your fix and it worked, thanks.

Using Moodle 1.5.2 and

General server information:
Operating systemLinux
Service StatusClick to View
Kernel version2.4.21-27.0.2.ELsmp
Machine Typei686
Apache version1.3.33 (Unix)
PERL version5.8.0
Path to PERL/usr/bin/perl
Path to sendmail/usr/sbin/sendmail
Installed Perl ModulesClick to View
PHP version4.4.0
MySQL version4.0.24-standard
cPanel Build10.2.0-STABLE 83
ThemecPanel X v2.5.0
DocumentationClick to View
In reply to Martin Dougiamas

Re: adodb.inc.php error msg - and Can't Log In

by Richard Page -
Martin,
Could this be related to the HTML editor problem?  Everything worked for me in Moodle 1.5.2 until the PHP change.  Fixing adodb.inc.php allowed me to log in, but ever since the HTML editor has been broken.  If I turn on debug, the only message I get is:
Notice: Only variable references should be returned by reference in /home/uzujbmi/public_html/moodle/lib/adodb/drivers/adodb-mysql.inc.php on line 73

But it doesn't seem to be affecting anything on the site.  The help for the HTML editor still appears, just no editor!

Others have reported that changing hosting services fixed this.  I suppose.  But next semester we are going to host it ourselves, so I want to stick with my current host until then (even though their support is particularly bad).  Is there another solution short of going back to an earlier version of PHP?

In reply to Martin Dougiamas

Re: adodb.inc.php error msg - and Can't Log In

by Peter Oleownik -

Hey,

during installation of my moodle 1.5.2 + stable I received the upper error message:

Notice: Only variable references should be returned by reference in /home... 

Then I found this thread an read it attentive. Then I only changed the one line in moodle/lib/adodb/adodb.inc.php by removing the &:

function &GetAssoc($sql, $inputarr=false,$force_array = false, $first2cols = false)

to this:

function GetAssoc($sql, $inputarr=false,$force_array = false, $first2cols = false)

and now my moodle works fine. I'm happy!

Thanks to you all of you for the great support!

Greetings from Germany!
Peter

In reply to Martin Dougiamas

Re: adodb.inc.php error msg - and Can't Log In

by David Gregg -

I'm afraid the problems could be much deeper seated than others have yet realised.

Has anyone, under PHP 4.40:

1. Installed Moodle from scratch? (I've tried and it can't get past variables).

2. Tried to create a new course on an existing installation? (All my Moodles fail with an error).

Latest Moodle, fix applied (several times, all suggestions).

I found this interesting discussion:

http://bugs.php.net/bug.php?id=33558

There appear to me to be many more "references calling references' in adodb.inc, which surface when you attempt the above.

Has anyone else found these problems? I'm on a different host, which has previously been exemplary.

In reply to David Gregg

Re: adodb.inc.php error msg - and Can't Log In

by Rob Johnson -
David - I was able to create a new course with the fix applied under PHP 4.4.0.  I had no error messages.  I was also able to upgrade Moodle as long as the fix is applied first.  I have not tried a fresh install.

Rob
In reply to Nicole Snyder

Re: adodb.inc.php error msg - and Can't Log In

by Nicole Snyder -
Thank you all, but now that I have reverted back to the moodle adodb and I have added the first fix to adodb.inc.php and I didn't get an error message but I am still unable to log in, I keep getting a session timed out message... So I then tried to apply Martins, fix and it still won't let me log in and keeps saying session timed out.

Thank you again everyone for all of your helpsmile

LV,
Nicole
In reply to Nicole Snyder

Re: adodb.inc.php error msg - and Can't Log In

by Nicole Snyder -
Yup, tried a few other things and I am continuing to have this problem. Please helpsad

Thanks,
Nicole
In reply to Nicole Snyder

Re: adodb.inc.php error msg - and Can't Log In

by Scott Grogg -
Nicole,

Have you tried accessing the site from another computer and web browser?  We noticed the session timeout issue a few times after making the fix.  Clearing the cache and even using another computer worked around the issue.  If it does not fix the problem, try using the attached file that incorporates the correct fix.

Scott
Average of ratings: Useful (1)
In reply to Scott Grogg

Re: adodb.inc.php error msg - and Can't Log In

by Nicole Snyder -
I cleared the cache, and tried the attached file. I am still unable to login to my site. I have recieved several emails from users reporting the same issue. AHHHHH HELPPPPPPP! I am so frustraited...

Thank You,
Nicole
In reply to Scott Grogg

Re: adodb.inc.php error msg - and Can't Log In

by Anibal Henares -

Thanks for the file Scott. I resolve the problem now.

Great. aprobación

In reply to Scott Grogg

Re: adodb.inc.php error msg - and Can't Log In

by Gregg Krech -
Hi Scott,

We used the file you provided to replace the existing file as you suggested

ADOdb version 4.50

Worked great!  Thanks to everyone who helped to figure this out.

Best wishes,

Gregg
www.distancelearningpsychology.org

In reply to Scott Grogg

Re: adodb.inc.php error msg - and Can't Log In

by Sergio Bacelar -
Hi Scott,

The fix (&) didn't work but when I uploaded the file with the correct fix everything worked fine.

Thanks,
Sergio
In reply to Sergio Bacelar

Re: adodb.inc.php error msg - and Can't Log In

by Deependra Tandukar -
I changed the line to
function GetAssoc($force_array = false, $first2cols = false )in my existing adodb.inc.php (moodle 1.5.2)- it stopped giving problem.

Thanks!!

DT
In reply to Scott Grogg

Re: adodb.inc.php error msg - and Can't Log In

by Hugo Sadofschi -

Thank you very much for the file, Scott.

I´ve uploaded it and all works fine again!!!

smilesmilesmilesmile

Regards,

Hugo

In reply to Scott Grogg

Re: adodb.inc.php error msg - and Can't Log In

by Daniel Jackson -
Thanks for attaching this file, Scott. This was giving me a real headache, but after upgrading to 1.5.2 and replacing adodb.inc.php with your file, things are looking good approve

DJ
In reply to Scott Grogg

Re: adodb.inc.php error msg - and Can't Log In

by Wouter De Backer -
My webprovider  UwHost.net did indeed upgrade to PHP 4.4.0 today. I upgraded to Moodle 1.5.2 and applied your fix by uploading your adodb.inc.php file to Moodle's adodb directory.

It fixes the problem for my Moodle installation at ICTbrokjes (in Dutch!) and I can again login to it.

For your reference I include part of the CPanel information about the server on which my copy of Moodle runs.

This discussion thread proves that Moodle support works ! And it works fast ! Between discovering the problem and solving it there merely elapsed about 40 minutes.

Many thanks for the solution. 

Operating system Linux
Service Status Click to View
Kernel version 2.4.21-27.0.2.ELsmp
Machine Type i686
Apache version 1.3.33 (Unix)
PERL version 5.8.4
Path to PERL /usr/bin/perl
Path to sendmail /usr/sbin/sendmail
Installed Perl Modules Click to View
PHP version 4.4.0
MySQL version 4.1.13-standard-log
cPanel Build 10.8.0-STABLE 59
Theme cPanel X v2.5.0
Documentation Click to View

In reply to paul rayner

Re: adodb.inc.php error msg - and Can't Log In

by nicolas patris -
Hello, I have the same problem (the same message : notice :...) and  I try various things to resolve it (change the line like the explicaction in the messages, upload the attached files from scott, etc.) but I can't resolve it... When I change the line, the message desappear but I can't login.

Any suggestions ?
Thank you and excuse my english.

Nicolas.
In reply to paul rayner

Re: adodb.inc.php error msg - and Can't Log In

by Athena Winchester -
Seeing there is no way I could do any of the technical stuff discussed here, is there someone I could maybe hire to fix this?
In reply to Athena Winchester

Re: adodb.inc.php error msg - and Can't Log In

by Richard Crawford -
I'm happy to try to give you a hand on this one issue.  Drop me a line and I'll see what I can do.
In reply to Athena Winchester

Re: adodb.inc.php error msg - and Can't Log In

by Brecht De Cooman -
Hi,

This weekend I also experienced the adodb.inc.php error; I discovered that our hosting company upgraded to PHP 4.4.1. (look at the details at the end of this post for more information);

I just downloaded the latest version of adodb , renamed the original \adodb to \adodb_old and unpacked the entire package of the newest version (4.66) to \adodb. This was all I had to do, because the problem was immediately resolved. I didn't even need to go and change the code of the adodb.inc.php file !!

Brecht De Cooman
(sano.ikorn.be)

Operating system FreeBSD
Kernel version 5.4-RELEASE-p1
Machine Type i386
Apache version 1.3.34 (Unix)
PERL version 5.8.7
Path to PERL /usr/bin/perl
Path to sendmail /usr/sbin/sendmail
PHP version 4.4.1
MySQL version 4.0.26-log
cPanel Build 10.8.1-STABLE 11




In reply to Brecht De Cooman

Re: adodb.inc.php error msg - and Can't Log In

by steven lyons -
I had this same problem today (I am running Moodle 1.5) and resolved it by making one simple change to the existing adodb.inc.php file:

On line 2615, I removed the ampersand (&) from this line:

function &GetAssoc($force_array = false, $first2cols = false)

to make it look like this:

function GetAssoc($force_array = false, $first2cols = false)

And viola! All seems well in moodleland.
In reply to Brecht De Cooman

Re: adodb.inc.php error msg - and Can't Log In

by Martin Dougiamas -
Core developersನ ಚಿತ್ರ Documentation writersನ ಚಿತ್ರ Moodle HQನ ಚಿತ್ರ Particularly helpful Moodlersನ ಚಿತ್ರ Plugin developersನ ಚಿತ್ರ Testersನ ಚಿತ್ರ
Yes, it seems ADOdb 4.66 finally fixes this problem once and for all.

I've updated to this version in STABLE and HEAD and it will be in 1.5.3 (which is imminent).   If you use a CVS version of Moodle under PHP 4.4.0, please upgrade and see if all is well.
In reply to Martin Dougiamas

Re: adodb.inc.php error msg - and Can't Log In

by Rob Johnson -
ADOdb 4.66 worked on my site smile.
In reply to Martin Dougiamas

Re: adodb.inc.php error msg - and Can't Log In

by Peter Ruthven-Stuart -
Plugin developersನ ಚಿತ್ರ
Hello,

In order to remove this error message and its related problems:

Notice: Only variable references should be returned by reference in /home/petesweb/public_html/moodle/lib/adodb/adodb.inc.php on line 2689

I have replaced the adodb.inc.php file with the same file from the Latest Stable Branch. Was this the right thing to do?

Like many of the people in the above thread, I also woke up this morning to find that my ISP (Bluehost) had upgraded PHP. I assume this is the case because I got the above error message on all four of my moodle sites:

Since I am not a programmer, I felt certain that I'd not be able to solve the problem any time soon. However, I did search for 'adodb.inc.php' and found this thread and, thanks to the above posts, the problem appears to have been solved. However, my solution was simply to replace the old adodb.inc.php file with the latest version. I did not change any of the code. Was this the right thing to do, and should I make any other changes?

Any advice will be much appreciated.

Moodle version: 1.5.2 +
PHP version: 4.4.1

In reply to Peter Ruthven-Stuart

Re: adodb.inc.php error msg - and Can't Log In

by Travis Daily -
I did this and it worked.  I have no clue what I am doing with this stuff but I ftp'd it in there and it worked....Thanks.