Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem with website after uploading to server.


willer2k

Recommended Posts

Posted

Hey there,

 

I modified my website on localhost and it is working fine, however, when I upload the website to the server, I am getting an error message when I try to login as a customer. : Fatal error: Call to a member function restore_contents() on a non-object in /.../.../public_html/login.php on line 144 and Fatal error:  Call to a member function count_contents() on a non-object in /.../.../public_html/includes/header.php on line 25

 

Settings issue? I have been reading it could be a plugin issue, where are the plugins?

 

localhost settings:

[oscommerce]
version = 2.3.4
 
[system]
date = 2016-02-15 19:02:06 +0100 CET
os = WINNT
kernel = 
uptime = 
http_server = Apache/2.4.9 (Win64) PHP/5.5.12
 
[mysql]
version = 5.6.17
date = 2016-02-15 13:02:06
 
version = 5.5.12
zend = 2.5.0
sapi = apache2handler
int_size = 4
safe_mode = 0
open_basedir = 0
memory_limit = 128M
error_reporting = 32759
display_errors = 1
allow_url_fopen = 1
allow_url_include = 0
file_uploads = 1
upload_max_filesize = 64M
post_max_size = 3M
disable_functions = 
disable_classes = 
enable_dl = 0
magic_quotes_gpc = 0
register_globals = 0
filter.default = unsafe_raw
zend.ze1_compatibility_mode = 0
unicode.semantics = 0
zend_thread_safty = 0
extensions = Core,bcmath,calendar,ctype,date,ereg,filter,ftp,hash,iconv,json,mcrypt,SPL,odbc,pcre,Reflection,session,standard,mysqlnd,tokenizer,zip,zlib,libxml,dom,PDO,bz2,SimpleXML,wddx,xml,xmlreader,xmlwriter,apache2handler,openssl,curl,com_dotnet,fileinfo,gd,gettext,gmp,imap,mbstring,exif,mysql,mysqli,Phar,pdo_mysql,pdo_sqlite,shmop,soap,sockets,sqlite3,xmlrpc,xsl,mhash,xdebug
 
 
 
mains server settings:
[oscommerce]
version = 2.3.4
 
[system]
date = 2016-02-15 12:02:28 -0600 CST
os = Linux
kernel = 3.12.41-77.ELK6.x86_64
uptime =  12:02:28 up 245 days, 13:58,  0 users,  load average: 0.06, 0.01, 0.00
http_server = Apache
 
[mysql]
version = 5.5.42-37.1
date = 2016-02-15 12:02:28
 
[php]
version = 5.2.17
zend = 2.2.0
sapi = cgi-fcgi
int_size = 8
safe_mode = 0
open_basedir = 0
memory_limit = 256M
error_reporting = 6135
display_errors = 1
allow_url_fopen = 1
allow_url_include = 1
file_uploads = 1
upload_max_filesize = 64M
post_max_size = 64M
disable_functions = dl
disable_classes = 
enable_dl = 0
magic_quotes_gpc = 0
register_globals = 1
filter.default = unsafe_raw
zend.ze1_compatibility_mode = 0
unicode.semantics = 0
zend_thread_safty = 0
extensions = date,libxml,openssl,pcre,zlib,bcmath,bz2,calendar,ctype,curl,dbase,dom,hash,filter,ftp,gd,gettext,session,iconv,standard,json,mbstring,mcrypt,mhash,mime_magic,mssql,mysql,SimpleXML,odbc,posix,pspell,Reflection,imap,SPL,mysqli,soap,sockets,exif,tidy,tokenizer,wddx,xml,xmlreader,xmlrpc,xmlwriter,xsl,zip,cgi-fcgi,magickwand,imagick,PDO,pdo_sqlite,SQLite,pdo_mysql,SourceGuardian,ionCube Loader,Zend Optimizer
 
 
any ideas? Anything would help.

 

Posted

The restore_contents() method should be defined in includes/classes/shopping_cart.php at line 20. Is it there?

 

It's likely that osCommerce will just not run on that old version of PHP. Anything older than version 5.5 is obsolete and unsupported. Ask your host about upgrading to a modern version. If they won't, find a new host.

 

Regards

Jim

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

Posted

"Call to a member function restore_contents() on a non-object" doesn't mean that method restore_contents() isn't defined. It means that the object that is supposed to contain this method was not properly created (class instantiation), and the method itself is a null or 0 value. If you're running PHP 5.2, it is quite possible that the osC code is trying to do something not supported until a later version of PHP. It's also possible that something else went wrong somewhere upstream of the object creation. Any decent host is up to PHP 5.4 by now at a bare minimum, with 5.5 and even 5.6 quite common. PHP 7 is coming out soon. If it's you who are deliberately keeping a back level of PHP so that you can run some old application on it, it's time to either upgrade/fix that application, or put it in its own subdirectory where you can (usually) specify its own version of PHP via .htaccess. Talk to your host about what can be done for that.

 

By the way, if you're just starting out with this website and store, give serious thought to skipping 2.3.4 and going to 2.3.4BS (responsive Bootstrap version), found on GitHub.

Posted

Hey MrPhil and kymation,

 

thanks guys, turns out I can select whatever PHP version I want from a drop down in my servers cPanel; selected 5.5 and all is working fine now! thank you guys!

 

However, it was always working fine in php 5.2. I didnt make any changes to shopping_cart.php nor the function it self. Only made changes to the login process.

Just curious why it stopped working now, but I do have other problems to worry about lol.

 

Thank you guys :)

Archived

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

×
×
  • Create New...