Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Canada Post Module - Decprecation Error


Recommended Posts

Posted

Hello all,

 

Up until recently, my install of the Canada Post Shipping Module has worked flawlessly. I do not know the exact date when this error started appearing, but it has to be sometime since 06/19/2006 (date of the last order processed).

 

Errors:

 

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of fsockopen(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /var/www/vhosts/francescoscoffee.com/httpdocs/osCommerce/includes/modules/shipping/canadapost.php on line 166

 

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of fsockopen(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /var/www/vhosts/francescoscoffee.com/httpdocs/osCommerce/includes/modules/shipping/canadapost.php on line 166

 

The corresponding code - lines 165-186:

// try to connect to Canada Post server, for 2 second
$fp = @fsockopen($host, $port, &$errno, &$errstr, 2);
if ( $fp ) {
  fputs($fp, "$method $path HTTP/1.1\n");
  fputs($fp, "Host: $host\n");
  fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
  fputs($fp, "Content-length: " . strlen($data) . "\n");
  if ($useragent)
	fputs($fp, "User-Agent: MSIE\n");
  fputs($fp, "Connection: close\n\n");
  if ($method == 'POST')
	fputs($fp, $data);

  while (!feof($fp))
	$buf .= fgets($fp,128);
  fclose($fp);
} else {
  $buf = '<?xml version="1.0" ?><eparcel><error><statusMessage>Cannot reach Canada Post Server.</statusMessage></error></eparcel>'; 
}

return $buf;
}

 

Anyone with a similar outcome, or any insight would be very helpful.

  • 1 month later...
Posted

Yes, I just installed the same shipping module and I'm getting exactly the same Warning messages.

 

Since I just downloaded OsCommerce and am developing my site, I don't know when the change took place. I would love to edit the .ini file, as suggested, as soon as I find the damn thing LOL

No Good Deed EVER Goes Unpunished

  • 2 weeks later...
Posted

This error seem to be an old command no more supported in PHP 5.0

 

But I don't know how to change the command to be correct. Here's the line that need to be changed:

 

$fp = @fsockopen($host, $port, &$errno, &$errstr, 2);

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...