Migrating to new server - Depreciation error in quiz

Migrating to new server - Depreciation error in quiz

by Brian Bevel -
Number of replies: 19
Hi. I'm migrating my Moodle installation to a new server, running on XAMPP (SUSE linux)
XAMPP is as follows:
Apache 2.2.12, MySQL 5.1.37, PHP 5.3.0 & PEAR + SQLite 2.8.17/3.6.16 + multibyte (mbstring) support, Perl 5.10.0, ProFTPD 1.3.2a, phpMyAdmin 3.2.0.1, OpenSSL 0.9.8k, GD 2.0.1, Freetype2 2.1.7, libjpeg 6b, libpng 1.2.12, gdbm 1.8.0, zlib 1.2.3, expat 1.2, Sablotron 1.0, libxml 2.7.2, Ming 0.4.2, Webalizer 2.21-02, pdf class 009e, ncurses 5.3, mod_perl 2.0.4, FreeTDS 0.63, gettext 0.17, IMAP C-Client 2007e, OpenLDAP (client) 2.3.11, mcrypt 2.5.7, mhash 0.8.18, eAccelerator 0.9.5.3, cURL 7.19.3, libxslt 1.1.8, phpSQLiteAdmin 0.2, libapreq 2.08, FPDF 1.6, XAMPP Control Panel 0.6, bzip 1.0.5, PBXT 1.0.08-rc, PBMS 0.5.08-alpha, ICU4C Library 4.2.1

Everything seems to be OK, but one of my testers encounters this error when accessing a quiz as a teacher:
Deprecated : Assigning the return value of new by reference is deprecated in /opt/lampp/htdocs/moodle/course/modedit.php on line 187

There is an open ticket in the Bug Tracker that is similar, but there doesn't seem to be any other info. I'm not sure yet if this will effect my students or not.

I've seen some indication on the web that this is either a PHP or a MySQL problem, but nothing definitive.

Any news on this "bug" Any thoughts?
Average of ratings: Useful (1)
In reply to Brian Bevel

Re: Migrating to new server - Depreciation error in quiz

by Colin Fraser -
Picture of Documentation writers Picture of Testers
It seems it is a PHP problem. Try going to PHP 5.2.9x, other people have had success with that move.
Average of ratings: Useful (2)
In reply to Colin Fraser

Re: Migrating to new server - Depreciation error in quiz

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
PHP 5.3 is still pretty new and not absolutely backwards compatible with 5.2.x. So, while it should work, there probably are bugs like this and unless you are brave or altruistic, it may be better to stick to 5.2.x for now, and let other people find the bugs wink
Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Migrating to new server - Depreciation error in quiz

by Amr Abdelazeez -
I face the same problem but when I move from PHP 5.3 to PHP 5.2 it’s work fine with me, thanks
In reply to Brian Bevel

Re: Migrating to new server - Depreciation error in quiz

by D Gottron -

Hi,

I want to see if there is any word about this bug:

"Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\moodle19\course\modedit.php on line 187"

I get the same error at the top of the page when adding any "Add a resource..." or "Add an activity..." to my new Moodle 1.9 using XAMPP on a WinXP OS running:

Apache Version : 2.2.11

PHP Version : 5.3.0

MySQL Version : 5.1.36

Oh and I am getting this on two fresh installs on my work desktop DEV system and my laptop.

Small SCORM zip files upload fine larger then 50m don't and give me a blank white page with the above error message. Not sure this error is causing it so I am still researching settings for very large SCORM video modules. Regardless I know it would be best to have this error (bug) resolved.

From this string from Sept. 2009 I would guess there would be a fix by now for PHP 5.3 and I am hoping that I will not have to hunt down a version of 5.2 and uninstall and reinstall it.

Please let me know if anyone has any more info about how to resolve the "bug" error message mentioned in this string.

Thanks,

d

In reply to D Gottron

Re: Migrating to new server - Depreciation error in quiz

by Cristiano Lopes -

Brothers,

I´m from Brasil and I have same problem with my system. Migrate server using easyPHP and the problem happens. The only diference is the SO, I has using WinXP and new server is 2003 Server.

Any anser ou tips for resolution is welcome.

Tanks and sorry for my poor english.

Cristiano Lopes

Curitiba - PR - Brasil

In reply to Cristiano Lopes

Re: Migrating to new server - Depreciation error in quiz

by D Gottron -

Well, I didn't find away to get rid of the error with PHP5.3 but I have determined that it is in fact PHP 5.3 causing the problem.

The good news is that I found the coolest thing from Wamp for developer systems://

////////////////////////////////////////////////////

PHP Addons

The PHP addons will give you te ability to install as much PHP releases as you want on your WampServer.

Just click on a link bellow, download and install the addon.

You will then be able to switch from one release to another from the WampServer menu.

////////////////////////////////////////////////////

Find it at : http://www.wampserver.com/addons_php.php

This made it possible to add PHP 5.9.11 and not reinstall everything and to my relief the error string disappeared. Though this solves my problem it doesn't help if you are stuck with a host server that only has PHP 5.3 on it. I am surprised not to see more post about this problem and would very much like to know when this is fixed.


d

Average of ratings: Useful (1)
In reply to D Gottron

Re: Migrating to new server - Depreciation error in quiz

by Bala kumar -
Hi gottron , You may follow the below code to over come this depricated issue. "Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\moodle\course\modedit.php on line 187" Actual code $mform = & new $mformclassname($form->instance, $cw->section, $cm); Which must be changed to: $mform = new $mformclassname($form->instance, $cw->section, $cm);
In reply to Bala kumar

Re: Migrating to new server - Depreciation error in quiz

by Andrew Osiname -

I have done that and now when i turn editing on and try and edit a topic, I just get the WSOD (white screen of death). I know the problem is in this file because I tried:

$mformclassname = 'mod_'.$module->name.'_mod_form';
print 1;
$mform =& new $mformclassname($form->instance, $cw->section, $cm);
print 2;
$mform->set_data($form);

and it only prints 1 then dies with no errors

I guess the problem may be when it tries to create the object? Any ideas?

Using Moodle 1.9.5 on PHP5.3.3 on test server.

Average of ratings: Useful (1)
In reply to Andrew Osiname

Re: Migrating to new server - Depreciation error in quiz

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Turn on Debugging, then you will get an error when it dies, and we will know what really is going on.

In reply to Tim Hunt

Re: Migrating to new server - Depreciation error in quiz

by William Mair -

Tim,

I made the changes to modedit.php and got the same white screen as Andrew, so turned on the debugging as suggested.

However, when I retry to upload my SCORM package, I get no debugging/error messages and still get a white screen.

Using XAMPP 1.7.4 (which is PHP 5.3.5) and Moodle version 1.9.7.

Any further advice/help

In reply to William Mair

Re: Migrating to new server - Depreciation error in quiz

by Andrea Gregory (Gordon) -

Hi guys.....

We have the same problem - any updates on it?

I am going to try updating to the latest 1.9 version. We need the later PHP vesion for running Moodle 2.. mixed

Will update thoughtful

Andrea

In reply to Andrea Gregory (Gordon)

Re: Migrating to new server - Depreciation error in quiz

by Andrea Gregory (Gordon) -

Updating to 1.9.12 did the trick! big grin

In reply to Andrea Gregory (Gordon)

Re: Migrating to new server - Depreciation error in quiz

by Beatriz Florian -

Hi Andrea

I have Moodle 1.9.12+ (Build: 20110701) but I still have the problem.

My XAMPP instalation is  XAMPP 1.7.4 with [PHP: 5.3.5].

What PHP version do you have?

Thanks,

In reply to Beatriz Florian

Re: Migrating to new server - Depreciation error in quiz

by Andrea Gregory (Gordon) -

Hi Beatriz,

It is version PHP 5.3.6.

Just looking back on this however as a different server is on the same version but still getting this error even after an update to the latest 1.9.13 version.

Will update when I find a solution!

Or if anyone has found one already?? smile

Cheers

Andrea

In reply to Andrea Gregory (Gordon)

Re: Migrating to new server - Depreciation error in quiz

by Andrea Gregory (Gordon) -

P.s. Turning debugging off globally removes the error

In reply to Andrea Gregory (Gordon)

Re: Migrating to new server - Depreciation error in quiz

by Fernando Meyer -

Hi,

I have the same problem of your post last days.

I removed the "&" but the problem still the same..

can you help me?

my php version is 

PHP 5.3.2 (cli) (built: Jun 25 2011 08:26:57)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

 

Thank you so much.

 

Fernando

In reply to Fernando Meyer

Re: Migrating to new server - Depreciation error in quiz

by David O'Brien -

Hello

Any updates to this please? I have the same error using

Moodle 1.9.9+ (Build: 20100714)

PHP Version 5.3.5

Thank you

In reply to David O'Brien

Re: Migrating to new server - Depreciation error in quiz

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

"Old code is using a funciton that has now been deprecated" is hardly surprising. Either turn of debuggin - these deprecated warnings can safely be ignored - or upgrade to the latest Moodle 1.9.14, to go with the latest PHP version.