Zen Cart Logo
Forums / Upgrading to 1.5.x / Blank admin login page - PHP Fatal error: Call to undefined function zen_get_ip_addr

Blank admin login page - PHP Fatal error: Call to undefined function zen_get_ip_addr

Views: 3,753

Results 1 to 5 of 5
27 Feb 2016, 3:30 AM
#1
batta avatar

batta

New Zenner

Join Date:
Oct 2010
Posts:
14
Plugin Contributions:
0

Blank admin login page - PHP Fatal error: Call to undefined function zen_get_ip_addr

I am upgrading from 1.3.9 to 1.5.4 (attempting to do it by the official Zen Cart method). After running zc_install when I attempted to log in to the admin area I got a blank screen. No error messages, nothing.

Checking the mydebug log I found

PHP Fatal error:  Call to undefined function zen_get_ip_address() in /xxxxxxxxxxxxx[admin]/includes/init_includes/init_sessions.php on line 34

Lines 30-37 of admin /includes/init_includes/init_sessions.php read as follows:

/**
 * tidy up $_SERVER['REMOTE_ADDR'] before we use it anywhere else
 */
$ipAddressArray = explode(',', zen_get_ip_address());
$ipAddress = (sizeof($ipAddressArray) > 0) ? $ipAddressArray[0] : '';
$_SERVER['REMOTE_ADDR'] = $ipAddress;

It is $ipAddressArray = explode(',', zen_get_ip_address()); which appears at line 34. When I comment out that line I am able to access my admin area and doing that has not led to any apparent problems, but since I do not understand the intent of that line and have not tried to go live I worry about unforeseen consequences. Can anyone tell me what problems may arise from commenting out that line and what I should do to fix it?

If relevant, PHP shows as version 5.4.45 and MySQL as version 5.5.45.

Thank you.

27 Feb 2016, 4:16 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Blank admin login page - PHP Fatal error: Call to undefined function zen_get_ip_addr

Apparently you haven't upgraded your /admin/includes/functions/general.php ... which is where that function is defined.

Or, you've replaced the new one with an old one when installing a plugin for an older version, instead of merging the changes into it.

28 Feb 2016, 1:22 AM
#3
batta avatar

batta

New Zenner

Join Date:
Oct 2010
Posts:
14
Plugin Contributions:
0

Re: Blank admin login page - PHP Fatal error: Call to undefined function zen_get_ip_addr

DrByte:

... replaced the new one with an old one when installing a plugin for an older version, instead of merging the changes into it.
Exactly right, Stock by Attributes caused my problem, and I now realized that the latest version of that is reported to be incompatible with ZC 1.5.4. I think I am under control now, and appreciate the information.

28 Feb 2016, 7:53 AM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Blank admin login page - PHP Fatal error: Call to undefined function zen_get_ip_addr

batta:

Exactly right, Stock by Attributes caused my problem, and I now realized that the latest version of that is reported to be incompatible with ZC 1.5.4. I think I am under control now, and appreciate the information.

Latest version of SBA is available from https://github.com/mc12345678/Stock_By_Attributes_Combined and is compatible with ZC 1.5.4.

10 Nov 2018, 12:32 PM
#5
janak avatar

janak

New Zenner

Join Date:
Apr 2017
Location:
vedchhi
Posts:
4
Plugin Contributions:
0

Re: Blank admin login page - PHP Fatal error: Call to undefined function zen_get_ip_addr

DrByte:

Apparently you haven't upgraded your /admin/includes/functions/general.php ... which is where that function is defined.

Or, you've replaced the new one with an old one when installing a plugin for an older version, instead of merging the changes into it.

I have Same Issues please help me when i upgrade zencart 1.5.5x to 5e

I AM HERE product_info
sidebox:

Explain
select products_type from zen_products where products_id = '839';

I AM HERE product_info
sidebox:

Explain
select type_handler from zen_product_types where type_id = '1';

I AM HERE product_info
sidebox:

Explain
select products_type from zen_products where products_id = '842';

I AM HERE product_info
sidebox:

Explain
select type_handler from zen_product_types where type_id = '1';