Author Topic: Deprecated: Assigning the return value of new by reference is deprecate  (Read 5510 times)

hunglu

  • Beginner
  • *
  • Posts: 4
Hi ,

I got this error: "Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\MyCompany15\modules\mod_virtuemart_latestprod\mod_virtuemart_latestprod.php on line 42"

I also saw some topic to talk about this error, but I dont know why when my PHP Version is 5.3.5

any one advise me,plz??

thanks

MobiVM

  • Full Member
  • ***
  • Posts: 267
    • Native Mobile Apps for VritueMart
Hi,

Issue you are facing is due to new PHP 5.3.5 which is shipped with WAMP2.0i but not with VM/Joomla.

You can choose one of the following:

User WAMP 2h (previous version)  or download PHP 5.2.9-2 addon from WAMP website.

Link to download 5.2.9-2 : http://downloads.sourceforge.net/wampserver/WampServer2-PHP529-2.exe?download

Once downloaded and installed go and select the 5.2.9 version and it will work okay.


Best Regards,
Trivedi Kartik
Native mobile Apps for VirtueMart! Visit http://www.ivmstore.com

hunglu

  • Beginner
  • *
  • Posts: 4
Do we have another way to help it works with Php 5.3.5 ???



jenkinhill

  • Global Moderator
  • Super Hero
  • *
  • Posts: 20835
  • Web developer and consultant
    • Jenkin Hill Internet
Both VM1.1 and Joomla1.5 work with PHP5.3 - it is just that you need to turn down the level of PHP error reporting. See http://forum.virtuemart.net/index.php?topic=77324.msg257759#msg257759 and http://forum.virtuemart.net/index.php?topic=77498.msg257431#msg257431
Kelvyn
Jenkin Hill Internet,
Keswick, Lake District

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

IMPORTANT:  VirtueMart versions before 2.6.10 are insecure. Updating is strongly advised.


Currently using VM2.6.10 on Joomla 2.5.24 PHP 5.4.21

Currently testing VM2.9.9cRC on J3.3.3

hunglu

  • Beginner
  • *
  • Posts: 4
I dont known why, I followed your solution, but it doen't treat .

Php.ini
error_reporting = E_ALL & ~E_NOTICE
display_errors = Off

Web server
XAMPP 1.7.4
PHP Version 5.3.5

the error is still happen
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\MyCompany15\modules\mod_virtuemart_latestprod\mod_virtuemart_latestprod.php on line 42

Sorry, I am a newbie. Please help me....

Thanks alot.

jenkinhill

  • Global Moderator
  • Super Hero
  • *
  • Posts: 20835
  • Web developer and consultant
    • Jenkin Hill Internet
There is probably more than one php.ini file
Kelvyn
Jenkin Hill Internet,
Keswick, Lake District

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

IMPORTANT:  VirtueMart versions before 2.6.10 are insecure. Updating is strongly advised.


Currently using VM2.6.10 on Joomla 2.5.24 PHP 5.4.21

Currently testing VM2.9.9cRC on J3.3.3

hunglu

  • Beginner
  • *
  • Posts: 4
Hi jenkinhill

I fixed it.

You are right, there is in some php file which set the value of error_reporting and display_errors  :'(

thanks for your help.

Hung, Lu

Epic Noob

  • Beginner
  • *
  • Posts: 3
There is an alternative solution of it also, just go to /modules/mod_virtuemart_latestprod/mod_virtuemart_latestprod.php, open it and then go to line 42.

It will show you the following code:-
$db =& new ps_DB;
$q  = "SELECT DISTINCT product_sku FROM #__{vm}_product, #__{vm}_product_category_xref, #__{vm}_category WHERE ";
$q .= "product_parent_id=''";
$q .= "AND #__{vm}_product.product_id=#__{vm}_product_category_xref.product_id ";

Solution:-
remove &  which acts as a reference. and den save it. That`s all, kechaww
$db =new ps_DB;
$q  = "SELECT DISTINCT product_sku FROM #__{vm}_product, #__{vm}_product_category_xref, #__{vm}_category WHERE ";
$q .= "product_parent_id=''";
$q .= "AND #__{vm}_product.product_id=#__{vm}_product_category_xref.product_id ";

I`m hoping that it would worked for you. I also had a same problem and then i removed this reference  sign and the error stopped displaying after that and my websites works smoothly after that

sonyarief

  • Beginner
  • *
  • Posts: 1
There is an alternative solution of it also, just go to /modules/mod_virtuemart_latestprod/mod_virtuemart_latestprod.php, open it and then go to line 42.

It will show you the following code:-
$db =& new ps_DB;
$q  = "SELECT DISTINCT product_sku FROM #__{vm}_product, #__{vm}_product_category_xref, #__{vm}_category WHERE ";
$q .= "product_parent_id=''";
$q .= "AND #__{vm}_product.product_id=#__{vm}_product_category_xref.product_id ";

Solution:-
remove &  which acts as a reference. and den save it. That`s all, kechaww
$db =new ps_DB;
$q  = "SELECT DISTINCT product_sku FROM #__{vm}_product, #__{vm}_product_category_xref, #__{vm}_category WHERE ";
$q .= "product_parent_id=''";
$q .= "AND #__{vm}_product.product_id=#__{vm}_product_category_xref.product_id ";

I`m hoping that it would worked for you. I also had a same problem and then i removed this reference  sign and the error stopped displaying after that and my websites works smoothly after that

Thanx a lot Epic Noob... Saved my day...   :)

VirtueMart Forum