Page 1 of 2

Strict Standards:Only variables should be assigned by refere

Posted: Fri May 06, 2011 10:30 am
by amir15622
Hello Guys,
I am using joomla 1.6 and each time I tried to install a new component and module that is expected to work fine and to compatible with 1.6 version i receive the following error:

Strict Standards: Only variables should be assigned by reference in C:\xampp\.......

following is my joomla1.6 System info:

PHP Built On Windows NT
Database Version 5.5.8
Database Collation utf8_general_ci
PHP Version 5.3.5
Web Server Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1
WebServer to PHP Interface apache2handler
Joomla! Version Joomla! 1.6.3 Stable [ Onward ] 18-Apr-2011 23:00 GMT
User Agent Mozilla/5.0 (Windows NT 6.0) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.60 Safari/534.24

Re: Strict Standards:Only variables should be assigned by re

Posted: Fri May 06, 2011 10:35 am
by OOmNezar

Re: Strict Standards:Only variables should be assigned by re

Posted: Fri May 06, 2011 10:41 am
by amir15622
in the php.ini there are 2 lines related to error reporting:


;error_reporting = E_ALL | E_STRICT
error_reporting = E_ALL & ~E_STRICT

which one should be commented out? by default first is commented but when I comment second one and uncomment first line , still will get the same error! :'(

Re: Strict Standards:Only variables should be assigned by re

Posted: Fri May 06, 2011 10:47 am
by OOmNezar
What if you try

Code: Select all

error_reporting = E_ALL
display_errors = Off
Or try http://forum.joomla.org/viewtopic.php?p ... 6#p2492426

Re: Strict Standards:Only variables should be assigned by re

Posted: Fri May 06, 2011 12:19 pm
by amir15622
Many thanks to OOmNezar for the help and providing useful comments and links.
what I did is the following to remove the Error:

1-completely uninstall XAMP
2-install WAMP 2.0
3-find and modify php.ini and modification is:

error_reporting = E_ALL
display_errors = Off

Error is gone and site and its module are working fine.

Cheers (Amir)

Re: Strict Standards:Only variables should be assigned by re

Posted: Wed Jun 01, 2011 3:55 pm
by DaniBlaa
I had this issue too.

I did not see any change after altering:

error_reporting = E_ALL
display_errors = Off

Closed my browser, and stopped and started Apache in Xamp en error messages were gone.

Re: Strict Standards:Only variables should be assigned by re

Posted: Wed Nov 16, 2011 12:44 am
by screaming
How about for those of us who are not on xampp? I have this issue using 1.7.3 on justhost.com.

Any help?

Re: Strict Standards:Only variables should be assigned by re

Posted: Wed Nov 16, 2011 1:17 am
by OOmNezar
Already try set in Global Configuration?
Site > Global Configuration > Server Settings > Error Reporting
http://docs.joomla.org/Help17:Site_Glob ... ion#Server

Re: Strict Standards:Only variables should be assigned by re

Posted: Wed Apr 11, 2012 2:34 am
by lies
You don't have to uninstall XAMPP and install WAMP to fix this! that just create a mess.

You have to adjust the "error_reporting" setting in your php.ini to get Joomla working.

- Open your php.ini
- search for

Code: Select all

error_reporting = E_ALL | E_STRICT
- change to

Code: Select all

error_reporting = E_ALL
- save the file
- STOP and restart Apache (A MUST)

I rather edit the php file than changing the Joomla backend error report because then you have to do that to all of your local sites. It's easier editing one file.

Re: Strict Standards:Only variables should be assigned by re

Posted: Mon Apr 23, 2012 12:58 pm
by BraveAli
Hello, i have the same problem, i put E_All in font of Error_reporting, and stop and restarted my Apachi, but still the following appearing on my screen
Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\modules\mod_susnet_likebox\mod_susnet_likebox.php on line 18

php.ini output
; error_reporting = E_All
; Default Value: E_ALL
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED

Please help...

thanks

Re: Strict Standards:Only variables should be assigned by re

Posted: Wed Apr 25, 2012 4:05 am
by MahmoudKhalaf
i have the same problem and tried your solves but doesn't work

my case : when i install K2 the errors is

Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\dr-abdeltawab\plugins\system\k2\k2.php on line 306

Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\dr-abdeltawab\plugins\system\k2\k2.php on line 27

and more
my php.ini is
;error_reporting = E_ALL & ~E_NOTICE
; Default Value: E_ALL
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED

My .htaccess i renamed to ".htaccess.txt"
contained ..
# supress php errors
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_value docref_root 0
php_value docref_ext 0
RewriteEngine On

please help me and thanks

Re: Strict Standards:Only variables should be assigned by re

Posted: Wed Apr 25, 2012 7:45 am
by BraveAli
i have solved that problem with the help of joomla forum, all you need is to go your Joomla main page, where you'll find Global Cofiguration, open it... >> click on Server Tab... >>in the Error Reporting.. put Maximum in it and just refresh your page, the Strict Standars will go away :) hope this would work for you!!

Re: Strict Standards:Only variables should be assigned by re

Posted: Wed Apr 25, 2012 10:24 am
by MahmoudKhalaf
really thank you a lot
i didn't have any words to say
you are the man
it works very well
thanks again

Re: Strict Standards:Only variables should be assigned by re

Posted: Wed Apr 25, 2012 11:22 am
by BraveAli
You are very welcome!!

Re: Strict Standards:Only variables should be assigned by re

Posted: Fri Apr 27, 2012 4:32 pm
by inderids
Tons of Thanks BraveAli

Re: Strict Standards:Only variables should be assigned by re

Posted: Fri Jun 01, 2012 6:10 pm
by TheArieList
Thank you everyone, especially Brave Ali and MahmoudKalif, for your comments and suggestions. I modified the php.ini as suggested and also changed the ERROR REPORTING on Global Configuration / SERVER / Error Reporting to MAXIMUM. The error message was resolved. Thank you again.

Re: Strict Standards:Only variables should be assigned by re

Posted: Fri Aug 10, 2012 5:16 pm
by qwan
This is the correct value for
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED

I don't why people are saying to use E_ALL. This will display all errors.
Including strict errors which joomla shows on Xampp
You can also use E_ALL & ~E_STRICT which will show all errors except strict ones.
I tried to change it to E_ALL and nothing happened. Then I just decided to read the instructions in the php.ini and its so clear there.

Re: Strict Standards:Only variables should be assigned by re

Posted: Fri Aug 10, 2012 5:55 pm
by justbrock
Does anyone know how to resolve these errors, not just changing the error reporting to hide them? I've been searching Google and the only information I can find are suggestions to change php.ini. Yes, this is a temp fix to get ride of the error on my site, however, I am an extension developer and I'd like to know what went wonky with my code (in regards to php5.4>)

Anyone?

Thanks in advance!

Re: Strict Standards:Only variables should be assigned by re

Posted: Fri Aug 17, 2012 2:22 pm
by izufrank
@justbrock, please let me know when you finally learn about the errors and find out a solution to it.

Re: Strict Standards:Only variables should be assigned by re

Posted: Fri Aug 17, 2012 2:27 pm
by izufrank
@quan, what is the difference between what you said and the solution about what @BraveAli has given? Because I use the one BraveAli gave and it worked - this is very easy. My question is, does it mean there might be a place where the error might occur i wouldnt know. Please explain.

Re: Strict Standards:Only variables should be assigned by re

Posted: Sat Sep 08, 2012 7:12 pm
by octoman
You saved my day @BraveAli.
Thank you.

Re: Strict Standards:Only variables should be assigned by re

Posted: Tue Sep 11, 2012 4:53 am
by BraveAli
Thanks for liking my post, wish you good luck with your work in joomla :)

Re: Strict Standards:Only variables should be assigned by re

Posted: Sun Sep 23, 2012 6:22 pm
by c47
Had same problems with Joomla 2.5 - after installing an extension, the error started to appear. I found my answer at stackoverflow (by Ozair Kafray):
You should remove the & (ampersand) symbol, so that line 4 will look like this:

$conn = ADONewConnection($config['db_type']);

From php's manual on assignment by reference:
As of PHP 5, the new operator returns a reference automatically, so assigning the result of new by reference results in an E_DEPRECATED message in PHP 5.3 and later, and an E_STRICT message in earlier versions.
In this context, line 4 is reffering to a line inside files at which your errors are pointing.

Re: Strict Standards:Only variables should be assigned by re

Posted: Sat Oct 20, 2012 11:12 am
by ElKeBusK
c47 wrote:Had same problems with Joomla 2.5 - after installing an extension, the error started to appear. I found my answer at stackoverflow (by Ozair Kafray):
You should remove the & (ampersand) symbol, so that line 4 will look like this:

$conn = ADONewConnection($config['db_type']);

From php's manual on assignment by reference:
As of PHP 5, the new operator returns a reference automatically, so assigning the result of new by reference results in an E_DEPRECATED message in PHP 5.3 and later, and an E_STRICT message in earlier versions.
In this context, line 4 is reffering to a line inside files at which your errors are pointing.
So if the problem persists after changes in php.ini and in global options this means the module scripts are bugged at the listed lines because of the ampersand, is that correct?

Re: Strict Standards:Only variables should be assigned by re

Posted: Mon Dec 03, 2012 6:55 am
by wizarddesign
if there is an error in a php file , I think it should be solved not just hide them!
i have done so and when i turned on the error reporting there was tons of error! this is not a good way. do you hide your symptoms when you are sick?

Re: Strict Standards:Only variables should be assigned by re

Posted: Sun Mar 03, 2013 5:11 pm
by sigfreed77
Ok guys, since I see you are suffering, I'm going to give you a hand. I will give you a few fixes in order to get these issues out of the way.

First Fix:
DO NOT ALTER THE FOLLOWING LINES
Document Name: php.ini
Line #

line 535

Code: Select all

 error_reporting = E_ALL | E_STRICT 
line 552

Code: Select all

 display_errors = On 
YOU DO NEED TO MODIFY THE FOLLOWING LINES AND DOCUMENTS
Second Fix:
Document Name: default.php

line 25
From

Code: Select all

$pageclass = & $app->getParams('com_content');
To

Code: Select all

$pageclass =  $app->getParams('com_content');

line 283
From

Code: Select all

$conf = & JFactory::getConfig();
To

Code: Select all

$conf = JFactory::getConfig();

line 284
From

Code: Select all

$sitename = $conf->getValue('config.sitename');
To

Code: Select all

$sitename = $conf->get('config.sitename');
line 293
From

Code: Select all

 $ice_session = & JFactory::getSession(); 
To

Code: Select all

 $ice_session =  JFactory::getSession(); 
Third Fix
Document Name: css_vars.php

line 10
From

Code: Select all

$doc = & JFactory::getDocument();
To

Code: Select all

$doc = JFactory::getDocument();
These fixes resolve the issues NOT just hide them, like the posts before mine suggested. Like my comment so others can see it, subscribe/follow me.

Re: Strict Standards:Only variables should be assigned by re

Posted: Thu Mar 14, 2013 6:27 pm
by kopi3310
Where is the file that need to edit locate? Thank you.
sigfreed77 wrote:Ok guys, since I see you are suffering, I'm going to give you a hand. I will give you a few fixes in order to get these issues out of the way.

First Fix:
DO NOT ALTER THE FOLLOWING LINES
Document Name: php.ini
Line #

line 535

Code: Select all

 error_reporting = E_ALL | E_STRICT 
line 552

Code: Select all

 display_errors = On 
YOU DO NEED TO MODIFY THE FOLLOWING LINES AND DOCUMENTS
Second Fix:
Document Name: default.php

line 25
From

Code: Select all

$pageclass = & $app->getParams('com_content');
To

Code: Select all

$pageclass =  $app->getParams('com_content');

line 283
From

Code: Select all

$conf = & JFactory::getConfig();
To

Code: Select all

$conf = JFactory::getConfig();

line 284
From

Code: Select all

$sitename = $conf->getValue('config.sitename');
To

Code: Select all

$sitename = $conf->get('config.sitename');
line 293
From

Code: Select all

 $ice_session = & JFactory::getSession(); 
To

Code: Select all

 $ice_session =  JFactory::getSession(); 
Third Fix
Document Name: css_vars.php

line 10
From

Code: Select all

$doc = & JFactory::getDocument();
To

Code: Select all

$doc = JFactory::getDocument();
These fixes resolve the issues NOT just hide them, like the posts before mine suggested. Like my comment so others can see it, subscribe/follow me.

Re: Strict Standards:Only variables should be assigned by re

Posted: Wed Aug 21, 2013 5:16 pm
by tedwyer
Hi All. I got the strict standards errors on all Joomla sites (and Wordpress) after moving all sites to a new server. The cause is PHP 5.4. Rolling back to 5.3.27 solved the problem.

Re: Strict Standards:Only variables should be assigned by re

Posted: Sun Sep 15, 2013 6:37 pm
by pishro
Strict Standards: Only variables should be assigned by reference
What exactly does this mean? I'm using JFactory just like it says in the docs. Should I be worried?

Googling the error only gives me a bunch of Joomla people saying I should just disable E_STRICT !

Re: Strict Standards:Only variables should be assigned by re

Posted: Thu Oct 31, 2013 12:17 am
by chrisinoz
Our ISP advised us all server being upgraded to 5.4 so I took out a short term hosting elsewhere that already had 5.4.2 installed. I loaded up a copy of one of my sites (2.5.7).

I got the Strict Standards errors so, since I did not have access to php.ini I created one in notepad and just added the lines

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED

and loaded the file into the root folder and that worked for me.

General Config setting for server is still System Default.

If you get errors like that in admin area just load the same php.ini file into the root folder of the admin area.

Cheers
Chris