Strict Standards:Only variables should be assigned by refere

This forum is for general questions about extensions for Joomla! 2.5.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
amir15622
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Fri May 06, 2011 10:19 am

Strict Standards:Only variables should be assigned by refere

Post by amir15622 » Fri May 06, 2011 10:30 am

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

User avatar
OOmNezar
Joomla! Ace
Joomla! Ace
Posts: 1869
Joined: Mon Sep 07, 2009 3:18 am

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

Post by OOmNezar » Fri May 06, 2011 10:35 am

coffee & smoke just fine
OOm Nezar

amir15622
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Fri May 06, 2011 10:19 am

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

Post by amir15622 » Fri May 06, 2011 10:41 am

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! :'(

User avatar
OOmNezar
Joomla! Ace
Joomla! Ace
Posts: 1869
Joined: Mon Sep 07, 2009 3:18 am

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

Post by OOmNezar » Fri May 06, 2011 10:47 am

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
coffee & smoke just fine
OOm Nezar

amir15622
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Fri May 06, 2011 10:19 am

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

Post by amir15622 » Fri May 06, 2011 12:19 pm

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)

DaniBlaa
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Jun 01, 2011 3:45 pm

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

Post by DaniBlaa » Wed Jun 01, 2011 3:55 pm

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.

screaming
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Fri Jan 28, 2011 4:36 pm

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

Post by screaming » Wed Nov 16, 2011 12:44 am

How about for those of us who are not on xampp? I have this issue using 1.7.3 on justhost.com.

Any help?

User avatar
OOmNezar
Joomla! Ace
Joomla! Ace
Posts: 1869
Joined: Mon Sep 07, 2009 3:18 am

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

Post by OOmNezar » Wed Nov 16, 2011 1:17 am

Already try set in Global Configuration?
Site > Global Configuration > Server Settings > Error Reporting
http://docs.joomla.org/Help17:Site_Glob ... ion#Server
coffee & smoke just fine
OOm Nezar

lies
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 133
Joined: Sat Aug 18, 2007 5:23 pm
Location: SoCal

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

Post by lies » Wed Apr 11, 2012 2:34 am

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.

User avatar
BraveAli
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Thu Oct 27, 2011 8:50 am

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

Post by BraveAli » Mon Apr 23, 2012 12:58 pm

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

MahmoudKhalaf
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Apr 25, 2012 3:52 am

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

Post by MahmoudKhalaf » Wed Apr 25, 2012 4:05 am

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

User avatar
BraveAli
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Thu Oct 27, 2011 8:50 am

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

Post by BraveAli » Wed Apr 25, 2012 7:45 am

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!!

MahmoudKhalaf
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Apr 25, 2012 3:52 am

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

Post by MahmoudKhalaf » Wed Apr 25, 2012 10:24 am

really thank you a lot
i didn't have any words to say
you are the man
it works very well
thanks again

User avatar
BraveAli
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Thu Oct 27, 2011 8:50 am

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

Post by BraveAli » Wed Apr 25, 2012 11:22 am

You are very welcome!!

inderids
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Fri Apr 27, 2012 4:30 pm

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

Post by inderids » Fri Apr 27, 2012 4:32 pm

Tons of Thanks BraveAli

TheArieList
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Jun 01, 2012 6:05 pm

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

Post by TheArieList » Fri Jun 01, 2012 6:10 pm

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.

qwan
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 101
Joined: Mon Nov 12, 2007 5:43 am

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

Post by qwan » Fri Aug 10, 2012 5:16 pm

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.

justbrock
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Thu Mar 06, 2008 12:22 am

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

Post by justbrock » Fri Aug 10, 2012 5:55 pm

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!

izufrank
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Aug 09, 2012 10:34 pm

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

Post by izufrank » Fri Aug 17, 2012 2:22 pm

@justbrock, please let me know when you finally learn about the errors and find out a solution to it.

izufrank
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Aug 09, 2012 10:34 pm

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

Post by izufrank » Fri Aug 17, 2012 2:27 pm

@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.

octoman
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Sep 08, 2012 12:17 pm
Contact:

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

Post by octoman » Sat Sep 08, 2012 7:12 pm

You saved my day @BraveAli.
Thank you.

User avatar
BraveAli
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Thu Oct 27, 2011 8:50 am

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

Post by BraveAli » Tue Sep 11, 2012 4:53 am

Thanks for liking my post, wish you good luck with your work in joomla :)

c47
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Aug 03, 2011 2:17 pm

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

Post by c47 » Sun Sep 23, 2012 6:22 pm

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.

ElKeBusK
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Sep 14, 2010 4:38 pm

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

Post by ElKeBusK » Sat Oct 20, 2012 11:12 am

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?

wizarddesign
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 142
Joined: Sat Apr 28, 2012 3:20 pm

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

Post by wizarddesign » Mon Dec 03, 2012 6:55 am

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?

sigfreed77
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Mar 03, 2013 4:38 pm
Location: Florida, US

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

Post by sigfreed77 » Sun Mar 03, 2013 5:11 pm

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.

kopi3310
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Jun 05, 2008 2:50 pm

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

Post by kopi3310 » Thu Mar 14, 2013 6:27 pm

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.

tedwyer
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Thu Aug 15, 2013 4:40 am

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

Post by tedwyer » Wed Aug 21, 2013 5:16 pm

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.

User avatar
pishro
Joomla! Explorer
Joomla! Explorer
Posts: 301
Joined: Tue Oct 09, 2012 7:22 am

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

Post by pishro » Sun Sep 15, 2013 6:37 pm

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 !

chrisinoz
Joomla! Intern
Joomla! Intern
Posts: 94
Joined: Fri Dec 02, 2005 3:52 am

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

Post by chrisinoz » Thu Oct 31, 2013 12:17 am

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


Locked

Return to “Extensions for Joomla! 2.5”