Zen Cart Logo

usps.php error

Locked

Views: 2,910

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
20 Nov 2007, 7:20 PM
#1
gerob avatar

gerob

New Zenner

Join Date:
Dec 2006
Posts:
8
Plugin Contributions:
0

usps.php error

I am running 1.3.7

I installed the new usps.php file to correct the shipping problems and now I get the following error:

Fatal error: Cannot redeclare class usps in /home/skycandl/public_html/includes/modules/shipping/usps.php on line **13

**This is the code:

<?php
/**
 * @package shippingMethod
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license [url]http://www.zen-cart.com/license/2_0.txt[/url] GNU Public License V2.0
 * @version $Id: usps.php 6474 2007-11-18 15:59:32Z ajeh $
 */
/**
 * USPS Shipping Module class
 *
 */
class usps extends base {
  /**
   * Declare shipping module alias code
   *
   * @var string
   */
  var $code;

I've tried changing class usps extends base { to class usps { but that didn't fix anything. I had uninstalled the module before installing the new file and I deleted the old file before uploading the new one.

Any help would be greatly appreciated.

Thank you,

20 Nov 2007, 7:28 PM
#2
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: usps.php error

you must totally rename the OLD usps.php file to something like usps.phpOLD

thisway the system dosnt try to readi it since these files auto load

20 Nov 2007, 7:36 PM
#3
gerob avatar

gerob

New Zenner

Join Date:
Dec 2006
Posts:
8
Plugin Contributions:
0

Re: usps.php error

Merlinpa1969:

you must totally rename the OLD usps.php file to something like usps.phpOLD

thisway the system dosnt try to readi it since these files auto load

I didn't rename the old file, I deleted it completely then uploaded the new file.

Permissions on the file are 0644

20 Nov 2007, 7:59 PM
#4
gerob avatar

gerob

New Zenner

Join Date:
Dec 2006
Posts:
8
Plugin Contributions:
0

Re: usps.php error

Additional information:

I'm also missing the right hand column on the admin/modules/shipping that has the options to install/edit/remove.

It's present on all other pages.

20 Nov 2007, 8:21 PM
#5
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: usps.php error

do you have a copy of the usps .php in an over rides folder?

20 Nov 2007, 8:34 PM
#6
gerob avatar

gerob

New Zenner

Join Date:
Dec 2006
Posts:
8
Plugin Contributions:
0

Re: usps.php error

Merlinpa1969:

do you have a copy of the usps .php in an over rides folder?

No, the only usps.php files on my server are:
includes/modules/shipping/usps.php
includes/language/english/modules/shipping/usps.php

And the only one I changed was the first one.

20 Nov 2007, 9:45 PM
#7
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,607
Plugin Contributions:
0

Re: usps.php error

What did you use to upload the files? Perhaps they were corrupted during the upload?

21 Nov 2007, 3:31 AM
#8
gerob avatar

gerob

New Zenner

Join Date:
Dec 2006
Posts:
8
Plugin Contributions:
0

Re: usps.php error

I've re-uploaded three times with three different programs, the builtin one in cPanel, CyberDuck and in place editing.

All have the same error.

21 Nov 2007, 3:43 AM
#9
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: usps.php error

Fatal error: Cannot redeclare class usps in /home/skycandl/public_html/includes/modules/shipping/usps.php on line 13

tells me that its declaring the class somewhere ELSE first,

try renaming the file you uploaded to includes/modules/shipping/usps.php to usps.phpOLD

see if you can still see the module

Humor me on this one

21 Nov 2007, 3:49 AM
#10
gerob avatar

gerob

New Zenner

Join Date:
Dec 2006
Posts:
8
Plugin Contributions:
0

Re: usps.php error

Renamed file to usps.phpOLD

The error goes away.... and the right hand column comes back, but there is no option for usps shipping to choose.

I've even tried replacing the original file back and I still get the error.

Oh, and I've not made any custom changes to the site other than graphics.

I agree it seems like it's declaring it else where, I just don't know where?

21 Nov 2007, 3:55 AM
#11
gerob avatar

gerob

New Zenner

Join Date:
Dec 2006
Posts:
8
Plugin Contributions:
0

Re: usps.php error

**PROBLEM RESOLVED
**

Lesson learned, don't let the end user have access to files.

After tearing my hair out all day I finally decide to just check all the other files, I start with UPS.php, guess what, that file had been overwritten with the code for the usps patch.

Called the client up and asked them if they changed that file, they* of course say no, I pepper them and eventually they come clean and say "You mean UPS isn't the same as the post office? I thought they were both the same so I changed both*"

ARGHHHHHH!!!! Earlier they swore up and down that they hadn't changed ANY files, now I find out they changed two! They not to even change files, ever.

Needless to say I billed overtime and changed the password.

Thanks for all your help.

13 Dec 2007, 10:53 PM
#12
jeffryf avatar

jeffryf

New Zenner

Join Date:
Nov 2006
Posts:
5
Plugin Contributions:
0

Re: usps.php error

I have a related problem. I can get the new module to work but it trashes the "Stpe 1" and "Step 2" pages (I haven't gone further assuming ugly and functional is better than totally not functionaly). Both pages list two warning:
**
Warning**: shipping(includes/languages/english/modules/shipping/usps.php) [function.shipping]: failed to open stream: No such file or directory in /nfs/www/WWW_pages/jeffryf/yourownhealthandfitness.org/ZenCart/
includes/classes/shipping.php
on line 44

Warning: shipping() [function.include]: Failed opening 'includes/languages/english/modules/shipping/usps.php' for inclusion (include_path='.:/opt/php/lib/php/') in /nfs/www/WWW_pages/jeffryf/yourownhealthandfitness.org/ZenCart
/includes/classes/shipping.php
on line **44

**This occurs whether I use the new or old usps.php.

The only way I could make this thing work is by renaming usps.php in the language/english/modules/shipping/ folder.

Admin>Modules>Shipping warns me as well with
Warning: main(/home/WWW_pages/jeffryf/yourownhealthandfitness.org/ZenCart/
includes/languages/english/modules/shipping/usps.php) [function.main]: failed to open stream: No such file or directory in /nfs/www/WWW_pages/jeffryf/yourownhealthandfitness.org/ZenCart
/admin/modules.php
on line 174

Warning: main() [function.include]: Failed opening '/home/WWW_pages/jeffryf/yourownhealthandfitness.org/ZenCart/includes/
languages/english/modules/shipping/usps.php' for inclusion (include_path='.:/opt/php/lib/php/') in /nfs/www/WWW_pages/jeffryf/yourownhealthandfitness.org/ZenCart/
admin/modules.php
on line **174
**
This is all quite baffling.

In addition, whereas Admin>Modules>Shipping said something like USPS, it now says MODULE_SHIPPING_USPS_TEXT_TITLE. Again, whether I use the new or original flavor of usps.php.

13 Dec 2007, 11:17 PM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: usps.php error

Almost everything in Zen Cart works in pairs ... if you have a module, you also have a language file for that module.

Your error messages are indicating that you're missing the language file for the indicated module.
Put the file back where it's supposed to be, and things should be fine again.