FAQ: Gallery2 "Notice: Only variable references should be returned by..."

Moderator: mcsmom

Post Reply
User avatar
guilliam
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 159
Joined: Thu Aug 18, 2005 10:27 am
Location: Sunny City Cebu, Philippines!
Contact:

FAQ: Gallery2 "Notice: Only variable references should be returned by..."

Post by guilliam » Fri Jan 20, 2006 11:37 pm

This is a SERVER side issue and NOT on the JOOMLA core. as reference and to qoute from the Gallery2's FAQ:

I get "Notice: Only variable references should be returned by reference in ", what's wrong?

Most probably you are running PHP 4.4.0+ and use the PHP Zend Optimizer (see phpinfo). You should deactivate the Zend Optimizer or use an older PHP version.

If you or your host is unwilling to disable the Zend Optimizer or change the PHP version, there's a workaround (solution discovered by Mark Scott, 13/10/2005, "I've found that removing optimization pass 1 removes the notices caused by optimizing away the variable that should be referenced and returned."):

In php.ini replace:

Code: Select all

zend_optimizer.optimization_level=15


with:

Code: Select all

zend_optimizer.optimization_level=14



This bug has been fixed in the 2.6 series of the Zend Optimizer. Confirmed working on 2.6.2 under Linux glibc2.1



FURTHER REFERENCES:

    *  How to handle references in PHP 4.4.0
    *  PHP Manual: References Explained




Forum Search keywords:

Only variable references should be returned by reference in ob_gzhandler zlib gallery2 
Notice: Only variable references should be returned by reference in /home/*******/public_html/gallery/lib/adodb/adodb.inc.php on line
Last edited by guilliam on Fri Jan 20, 2006 11:54 pm, edited 1 time in total.
"I was one of those who wondered why people would pay so much $$$$ to do something that was so much fun!" -R. Harkrider, Fortran Code Engr.
^If u read that in $GREEN, you clearly missed the HIGHLIGHTS!
http://www.joomlancers.com | http://www.joomlaconsultancy.net

de
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Thu Aug 18, 2005 9:06 am
Contact:

Re: FAQ: "Notice: Only variable references should be returned by reference in...

Post by de » Fri Jan 20, 2006 11:47 pm

I think that alone may be misleading. There may be bugs in the optimiser... but a "Only variable references should be returned by reference" notice was triggered also for true "errors" (in PHP 4.4.0+/5.1+ they decided to some changes which made it incompatible a bit but did not really work well before anyway as stated in one of the bug reports).

So seeing that notice does not necessarily mean that it is a optimiser bug, it could also be the addon/library used.
(Often notice messages are not displayed due to the error reporting setting... which can be change in the Global Configuration)

User avatar
guilliam
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 159
Joined: Thu Aug 18, 2005 10:27 am
Location: Sunny City Cebu, Philippines!
Contact:

Re: FAQ: "Notice: Only variable references should be returned by reference in..."

Post by guilliam » Fri Jan 20, 2006 11:53 pm

thanks @ daniel.. first post edited to be specific for G2(gallery 2) integration.

- g
"I was one of those who wondered why people would pay so much $$$$ to do something that was so much fun!" -R. Harkrider, Fortran Code Engr.
^If u read that in $GREEN, you clearly missed the HIGHLIGHTS!
http://www.joomlancers.com | http://www.joomlaconsultancy.net


Post Reply