Post by showtecuk » Fri Sep 25, 2015 6:32 pm

Hi, I have just upgraded our store to the latest version, 2.0.3.1 from 1.5, and we now get an error at the top of every page:

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/showtec/public_html/onlineshop/index.php on line 140

It appears to be in the language detection part of the index.php file, although my knowledge kind of end there. Additionally, when you go to the register page (to add yourself as a customer), you get a more in depth error message pop up which seems to be related. In the region / state drop down box there are then no options to choose from.

Site is http://www.showtec.co.uk/onlineshop for reference, and the main error comes up on this page:

http://www.showtec.co.uk/onlineshop/ind ... t/register

Any help would be appreciated.

Jon

Newbie

Posts

Joined
Fri Sep 25, 2015 6:08 pm

Post by deepvision » Sun Sep 27, 2015 12:31 pm

How did you upgrade the opencart?
Make sure you have

Code: Select all

register_globals
set to off. It may cause this error.
To check you can upload the install folder from the latest opencart installation and then run it so it can check the settings. Notice if it warns you about register_globals.

ImageImageImage


User avatar
Active Member

Posts

Joined
Tue May 19, 2015 1:03 am

Post by showtecuk » Mon Sep 28, 2015 11:00 pm

Where would that normally be located?

I did some searching on google when the error first happened and found that reccomendation, and we do have a php.ini file in the root directory with the following:

magic_quotes_gpc = Off;
register_globals = Off;
default_charset = UTF-8;
memory_limit = 64M;
max_execution_time = 36000;
upload_max_filesize = 999M;
safe_mode = Off;
mysql.connect_timeout = 20;
session.use_only_cookies = On;
session.use_trans_sid = Off;
session.cookie_httponly = On;
session.gc_maxlifetime = 3600;
allow_url_fopen = on;
;display_errors = 1;
;error_reporting = E_ALL;

Newbie

Posts

Joined
Fri Sep 25, 2015 6:08 pm

Post by OSWorX » Mon Sep 28, 2015 11:42 pm

showtecuk wrote:Where would that normally be located?

I did some searching on google when the error first happened and found that reccomendation, and we do have a php.ini file in the root directory with the following:

magic_quotes_gpc = Off;
register_globals = Off;
default_charset = UTF-8;
memory_limit = 64M;
max_execution_time = 36000;
upload_max_filesize = 999M;
safe_mode = Off;
mysql.connect_timeout = 20;
session.use_only_cookies = On;
session.use_trans_sid = Off;
session.cookie_httponly = On;
session.gc_maxlifetime = 3600;
allow_url_fopen = on;
;display_errors = 1;
;error_reporting = E_ALL;
Basically it is one of the most stupied ideas to provide a software package with such obstruse settings like they are in the enclosed standard php.ini

First of all it has to be enabled in your server settings to call this file (either ask your provider or check it by yourself via php_info(); ) - you will have no access to such files. If your provider does not allow to include custom ini-files, it does no matter what you define in there, these setting will simply not considered (the file can also be deleted then)

Second, if ever your provider do allow loading these .ini-files, I am sure they will not allow settings like these values for filesize or fopen (for example)

Third: if your provider know how a webserver shall be configured, they have already disabled the register_globals.
If not, I would recommend to change the provider.

Custom Development | Individuelle Entwicklung | Support & Bugfixes

Image Image Image


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by showtecuk » Tue Sep 29, 2015 12:31 am

Hi, we have checked and the register_globals is turned off by default on the server.

We had the version 1.5.6.4 working perfectly before this upgrade to 2.0.3.1.

Newbie

Posts

Joined
Fri Sep 25, 2015 6:08 pm
Who is online

Users browsing this forum: No registered users and 21 guests