Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PHP Error


Guest

Recommended Posts

I attempted to install oscommerce, and it said the installation was finished but there was an PHP error that came on the top of the page:

 

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; PasswordHash has a deprecated constructor in /homepages/7/d658059603/htdocs/oscommerce-2.3.3.4/catalog/includes/classes/passwordhash.php on line 32

 

 

 

When I click on the links that say Online Store and Administration Tool, I get the following errors on repeat over and over again:

 

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; shoppingCart has a deprecated constructor in /homepages/7/d658059603/htdocs/oscommerce-2.3.3.4/catalog/includes/classes/shopping_cart.php on line 13

 

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; logger has a deprecated constructor in /homepages/7/d658059603/htdocs/oscommerce-2.3.3.4/catalog/admin/includes/classes/logger.php on line 13

 

 

 

I have no idea why this stuff comes up or how and where to fix it. Can anybody help me install this? You can see the file links here:

 

http://geniaquaria.com/oscommerce-2.3.3.4/catalog/index.php

http://geniaquaria.com/oscommerce-2.3.3.4/catalog/admin/index.php

 

 

Link to comment
Share on other sites

Hello Maria @@geniaquaria,

 

It seems you have installed version 2.3.4 or 2.3.4 Bootstrap. They are not yet compatible with PHP 7.

You should run a PHP version not higher than 5.5.

 

The new version 2.4 which is in beta test phase will allow to run under PHP 7.

 

Anyway make sure to use the 2.3.4 Bootstrap responsive community version for a new installation.

You can download it here:

https://github.com/gburton/osCommerce-234-bootstrap/archive/master.zip

 

rgds

Rainer

Link to comment
Share on other sites

Isn't osC 2.3.4BS Edge PHP 7-ready? Not Gold.

 

I suspect that the OP installed regular osC 2.3.4, which is not 7-ready, and may not even be 5.6-ready (it's quite old).

 

Unfortunately, Harald has really been missing the boat and is killing osCommerce by his failure to promote 2.3.4BS on the download page, or even better, offering it as a 2.3.5 official release. I know he wants to get 2.4 out, but it could be years before it's the official release, and in the meantime, 2.3.4 grows ever older...

Link to comment
Share on other sites

What is the problem with PHP 5.6 ?

OK, for production purpose with the standard error reporting set to:

  error_reporting(E_ALL & ~E_NOTICE);

it should be ok, but with:

  error_reporting(E_ALL);

undefined constant and variable errors are showing up under php 5.6

That's why I still run 2.3.4 EDGE under 5.5, but for develop purposes.

 

EDIT: just checked and found that the errors also show under 5.5, so I must be wrong, thought there was some reason, then if 5.5 is ok, 5.6 should be too.

 

Isn't osC 2.3.4BS Edge PHP 7-ready? Not Gold.

 

I suspect that the OP installed regular osC 2.3.4, which is not 7-ready, and may not even be 5.6-ready (it's quite old).

 

Unfortunately, Harald has really been missing the boat and is killing osCommerce by his failure to promote 2.3.4BS on the download page, or even better, offering it as a 2.3.5 official release. I know he wants to get 2.4 out, but it could be years before it's the official release, and in the meantime, 2.3.4 grows ever older...

 

Latest EDGE has still not the PHP7 compatibility commits merged.

Most class contructors are not updated yet.

 

rgds

Rainer

Link to comment
Share on other sites

undefined constant and variable errors are showing up under php 5.6

If you're getting those errors on PHP 5.5 or 5.6 (or 7.0, for that matter), those are serious bugs and need to be fixed ASAP. It's OK to temporarily suppress them on a production system so that visitors don't see the site innards (the messy side of sausage making), but don't ignore them. If it's just a matter of tweaking error_reporting(), I don't see that as a sufficient reason to use a back-level PHP.

 

No code should be let out in the first place if it's producing undefined constant and variable errors -- that's basic checking and cleanup that needs to be done before release. Of course, it could be on a very rarely used code path, in which case it's somewhat excusable. It could also be something strange with your system, and neither the developer nor most users see it!

 

If language syntax changes and deprecated items (e.g., constructor names) are showing up, that would be reason to go back-level until the matter is resolved. They could be suggesting that more subtle problems are lurking in the code.

 

Latest EDGE has still not the PHP7 compatibility commits merged.

Most class contructors are not updated yet.

Huh. I thought I had read that EDGE was fully PHP 7 ready. My bad.

Link to comment
Share on other sites

If you're getting those errors on PHP 5.5 or 5.6 (or 7.0, for that matter), those are serious bugs and need to be fixed ASAP. It's OK to temporarily suppress them on a production system so that visitors don't see the site innards (the messy side of sausage making), but don't ignore them. If it's just a matter of tweaking error_reporting(), I don't see that as a sufficient reason to use a back-level PHP.

 

I'm referring to errors showing up only if error reporting is set to "all", they show up with unmodified, fresh installed 2.3.4 EDGE.

These are not critical errors or serious bugs.

Link to comment
Share on other sites

If an unmodified, fresh out-of-the-box installation is showing undefined constants and variables, I certainly consider those to be serious. We can agree to disagree on the seriousness of this, but I won't release code out that has such obvious problems. It makes the developer look bad that such things were let through.

Link to comment
Share on other sites

It *looks* like the original poster is trying to install version 2.3.3.4

Oh yes, sometimes we oversee obvious things. How did he get that outdated version?

Although 2.3.4 and 2.3.4BS will throw the same errors under PHP7

Link to comment
Share on other sites

You need to set up your redirect (or server web base directory) before installing osCommerce. Or you can change the references in osC by hand, but that's harder.

 

There is nothing wrong with the latest version. Your download was just corrupted. Go download it again, and install it after you get your redirect in place.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I have the store at http://geniaquaria.com/catalog/index.php, can't seem to figure out how to redirect http://geniaquaria.com to that page. I tried doing HTTP redirect and change the webspace destination but the site just broke down on me again.

 

How did you attempt to redirect it? The following .htaccess code should work on an Apache server:

RewriteEngine On
RewriteCond  %{REQUEST_URI}  !^/catalog  [NC]
RewriteRule  ^(.*)$   /catalog/$1 [L]

Or something close to that... some servers have quirks you may need to work around. It usually won't work on Microsoft (Windows) servers or Nginx.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...