1
huyhoa
Help me : Notice: Only variable references should be returned by reference
  • 2007/3/3 12:50

  • huyhoa

  • Just popping in

  • Posts: 1

  • Since: 2007/3/3 7


Help me please, when i install xoop 2.2 it display this:
Notice: Only variable references should be returned by reference in
And in homepage it display
Quote:

Selected module does not exist!

If the page does not automatically reload, please click here



Quote:
Notice [PHP]: Undefined index: enable_badips in file class/xoopssecurity.php line 212
Notice [PHP]: Undefined index: language in file include/common.php line 152
Notice [PHP]: Undefined index: language in file include/common.php line 172
Notice [PHP]: Only variable references should be returned by reference in file include/functions.php line 566
Notice [PHP]: Only variable references should be returned by reference in file include/functions.php line 566
Notice [PHP]: Only variable references should be returned by reference in file include/functions.php line 566
Notice [PHP]: Only variable references should be returned by reference in file include/functions.php line 566
Notice [PHP]: Undefined index: use_ssl in file include/common.php line 183
Notice [PHP]: Undefined index: use_mysession in file include/common.php line 185
Notice [PHP]: Only variables should be assigned by reference in file class/database/mysqldatabase.php line 249
Notice [PHP]: Only variable references should be returned by reference in file class/database/mysqldatabase.php line 256
Notice [PHP]: Only variable references should be returned by reference in file class/database/mysqldatabase.php line 397
Notice [PHP]: Only variable references should be returned by reference in file include/functions.php line 566
Notice [PHP]: Only variables should be assigned by reference in file class/database/mysqldatabase.php line 249
Notice [PHP]: Only variable references should be returned by reference in file class/database/mysqldatabase.php line 256
Notice [PHP]: Only variable references should be returned by reference in file class/database/mysqldatabase.php line 397
Notice [PHP]: Only variable references should be returned by reference in file kernel/module.php line 1287
Notice [PHP]: Only variables should be assigned by reference in file include/common.php line 215
Notice [PHP]: Undefined index: banners in file include/common.php line 235
Notice [PHP]: Undefined index: debug_mode in file include/common.php line 235
Warning [PHP]: in_array() [function.in-array]: Wrong datatype for second argument in file include/common.php line 235
Notice [PHP]: Undefined index: theme_fromfile in file class/template.php line 66
Notice [PHP]: Undefined index: gzip_compression in file class/theme.php line 143
Notice [PHP]: Undefined index: sitename in file class/theme.php line 411
Notice [PHP]: Undefined index: slogan in file class/theme.php line 412
Notice [PHP]: Only variable references should be returned by reference in file include/functions.php line 566
Notice [PHP]: Only variables should be assigned by reference in file class/database/mysqldatabase.php line 249
Notice [PHP]: Only variable references should be returned by reference in file class/database/mysqldatabase.php line 256
Notice [PHP]: Only variable references should be returned by reference in file class/database/mysqldatabase.php line 397
Notice [PHP]: Only variable references should be returned by reference in file kernel/configitem.php line 212
Notice [PHP]: Only variable references should be returned by reference in file kernel/config.php line 200
Notice [PHP]: Undefined index: slogan in file class/theme.php line 430
Notice [PHP]: Undefined index: closesite in file include/common.php line 238
Notice [PHP]: Undefined index: use_mysession in file include/functions.php line 399
Notice [PHP]: Undefined index: theme_set in file class/theme.php line 249
Notice [PHP]: Undefined index: theme_set in file include/functions.php line 450
Notice [PHP]: Undefined index: language in file class/theme.php line 269
Notice [PHP]: Undefined index: theme_set in file include/functions.php line 450
Notice [PHP]: Undefined index: debug_mode in file footer.php line 44
Warning [PHP]: in_array() [function.in-array]: Wrong datatype for second argument in file footer.php line 44


See here:http://eng.huyhoa.com

Please help me. Thanks

2
ron-cpw
Re: Help me : Notice: Only variable references should be returned by reference
  • 2007/3/3 13:29

  • ron-cpw

  • Just popping in

  • Posts: 82

  • Since: 2006/12/19


If this is a fresh, new site... I would wipe all clean and start over with XOOPS 2.0.16

It is my understanding that 2.2 is not a good choice.

3
seventhseal
Re: Help me : Notice: Only variable references should be returned by reference

Quote:
Notice [PHP]: Only variables should be assigned by reference in file include/common.php line 215


These are slowly getting cleaned up, but I see them and usually fix them throughout XOOPS core code - and some modules

The problem, is more pronounced as you move to PHP5.x versions.

The problem, if you want to learn programming, is that each of the notices is referring to the way the function is returning the assigned value. In this case, there is no assigned value, only a result.

For instance if I have a return like this
return new SomeFunction();


I will see the message similar to yours.

If I change it to
$someReturn = new SomeFunction();
return 
$someReturn;


The message goes away.

The first example is coder laziness. Not saying anything about the coder, I've done it myself! However, at the assembled code level, you are telling and assuming that the resultant code will create a slot that is going to be globally accessible to the code receiving the returned value. In other words, if a reserved place is not created (the variable $someReturn), I am not assured that the returned value won't get stomped on in memory. With Web applications, this is not too big a deal. In large scale system applications, this form of coding could bite you pretty hard.
John Horne - a.k.a. - VelocityWebDev, Seventhseal, CreepingDeath
**********************************
VelocityWebDev Tech BLOG
VelocityWebHost Hosting and Design

4
Peekay
Re: Help me : Notice: Only variable references should be returned by reference
  • 2007/3/3 15:04

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


There's another report about the variables error message in this thread.

As seventhseal says, there was a core change in PHP 4.4 that was not backward compatible with some of the code used in XOOPS 2.2. In PHP 4.4 you got a warning notice (depending on your php.ini error reporting options). In PHP 5.05 the change was enforced and you will get an error.

As others suggest, I would use XOOPS 2.0.16, however as the above mentioned thread shows, you may still find issues with some older modules.
A thread is for life. Not just for Christmas.

Login

Who's Online

223 user(s) are online (163 user(s) are browsing Support Forums)


Members: 0


Guests: 223


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits