Page 1 of 1

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

Posted: Fri Jan 20, 2006 11:37 pm
by guilliam
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

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

Posted: Fri Jan 20, 2006 11:47 pm
by de
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)

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

Posted: Fri Jan 20, 2006 11:53 pm
by guilliam
thanks @ daniel.. first post edited to be specific for G2(gallery 2) integration.

- g