Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Admin login loop after upgrade 2.3.3.1 to 2.3.3.2


Patrick73

Recommended Posts

Hey all,

 

Just upgraded my files and can not login to admin. Keep getting loop error in browser. I have cleared cache and cookies but did not help. Catalog side works fine.

 

Error messages is:

 

PHP Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /home.../admin/includes/functions/database.php on line 43

 

PHP Warning: mysqli_errno() expects parameter 1 to be mysqli, null given in /home/...admin/includes/functions/database.php on line 43

 

PHP Warning: mysqli_error() expects parameter 1 to be mysqli, null given in /home/...admin/includes/functions/database.php on line 43

 

Thanks

Link to comment
Share on other sites

got the same error when updating from 2.3.3.1 onto 2.3.3.2

in the meantime I did a lot of testing and it indeed has something todo with admin/includes/functies/database.php

if I overwrite the 2.3.3.2 database.php file with the 2.3.3.1 database.php file the issue has been resolved, nevertheless ofcourse do we miss the 'new/improved' coding in database.php file....

Link to comment
Share on other sites

@@Patrick73

 

There is no mysqli_query in that line. Copy to the original file content into the right place.

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

The error means that you dont have connection with database.

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

 

This is not solving the issue....still giving the same error.

Strange enough, on the front-end site these database changes does not give any issues......so only on the back-end site it does.

Link to comment
Share on other sites

Hi Renzo..

 

Could you confirm that the same database connection parameters (server, username, password, database name) are being used in:

 

catalog/includes/configure.php, and

catalog/admin/includes/configure.php

 

Is anything also being reported in your webserver and/or PHP error log?

:heart:, osCommerce

Link to comment
Share on other sites

Hi Harald,

 

catalog/includes/config.php:

define('HTTP_SERVER', 'mywebsite');

define('HTTPS_SERVER', 'mywebsite');

define('ENABLE_SSL', 'false');

define('HTTP_COOKIE_DOMAIN', 'mywebsite');

define('HTTPS_COOKIE_DOMAIN', 'mywebsite');

define('HTTP_COOKIE_PATH', '');

define('HTTPS_COOKIE_PATH', '');

define('DIR_WS_HTTP_CATALOG', '');

define('DIR_WS_HTTPS_CATALOG', '');

define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_INCLUDES', 'includes/');

define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

 

define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');

define('DIR_FS_CATALOG', 'full server link to my website');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

// define our database connection

define('DB_SERVER', 'localhost');

define('DB_SERVER_USERNAME', 'myusername');

define('DB_SERVER_PASSWORD', 'mypassword');

define('DB_DATABASE', 'mydatabase');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', 'mysql');

 

catalog/admin/includes/configure.php:

define('HTTP_SERVER', 'mywebsite');

define('HTTP_CATALOG_SERVER', 'mywebsite');

define('HTTPS_CATALOG_SERVER', 'mywebsite');

define('ENABLE_SSL_CATALOG', 'false');

define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT);

define('DIR_WS_ADMIN', 'my admin dir');

define('DIR_FS_ADMIN', 'full server link to my website including admin dir');

define('DIR_WS_CATALOG', '');

define('DIR_FS_CATALOG', 'full server link to my website');

define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');

define('DIR_WS_INCLUDES', 'includes/');

define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');

define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');

define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');

define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');

define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

define('DIR_WS_HTTPS_CATALOG', '/shop/');

 

// define our database connection

define('DB_SERVER', 'localhost');

define('DB_SERVER_USERNAME', 'myusername');

define('DB_SERVER_PASSWORD', 'mypassword');

define('DB_DATABASE', 'mydatabase');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', 'mysql');

Link to comment
Share on other sites

Hello Harald,

 

I have check both database settings in configure files and they are the same.

 

The browser redirection loop error happens if we do not logoff admin before modifying the admin/includes/functions/database file. If I logoff, modify thedatabase.php file, then I can access admin/login but I can not login to admin and it is not recorded in the action_recorder table in database as success = 0

 

Oddly, seems to connect to database enough to open login.php but not enough to login.

 

Hope this helps.

 

Patrick

Link to comment
Share on other sites

Hi Patrick, not sure if you solved your issue, but I did not.....

It also looks like we have a challange as I uploaded the full package of osc2.3.3.2 onto my test server, added a new database for it and installed osc2.3.3.2..........and it is working out of the box!!!!

 

So;

- or the update package is incorrect (which i do not think as i only see you and me with this issue),

- or we messed up by updating manually,

- or we, at least I do, have some addons installed (which I checked on coding and are fine as far as I can see) including some hardcoded changes as layout which is causing the issue......

Link to comment
Share on other sites

Hey Renzo,

 

If I leave database.php as per 2.3.3.1, the login is fine...

 

Also, I can't access server_info.php with upgrade. Getting:

PHP Fatal error: Call to undefined function tep_db_get_server_info() in .../includes/functions/general.php on line 925

 

Which is again database related:

 

$data['mysql'] = array('version' => tep_db_get_server_info()

 

Could our problem be server/mysql related?

 

Here'S my setup

Linux 2.6.18-448.4.1.el5.lve0.8.69.1 MySQL 5.5.33 Apache/2 php 5.3.27 (Zend: 2.3.0)

 

I too have addons, but I never mess with anything on the admin especially login and security.

Link to comment
Share on other sites

tep_db_get_server_info() was added in the 2.3.3.2 upgrade. It sounds like you didn't complete the upgrade. Check all of your patches again.

 

Regards

Jim

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

Link to comment
Share on other sites

tep_db_get_server_info() was added in the 2.3.3.2 upgrade. It sounds like you didn't complete the upgrade. Check all of your patches again.

 

Regards

Jim

 

Hi Jim,

 

Adding the tep_db_get_server_info to includes/functons/general causes the error, if I leave it has is before update, server_info.php opens fine.

Will double check every patches again as you suggested, has this has got a problem i've caused.

 

Thanks

Link to comment
Share on other sites

PHP Fatal error: Call to undefined function tep_db_get_server_info() in .../includes/functions/general.php on line 925

 

Thanks Jim,

 

The function was only there once.

 

As with the login problem, both line in both files have to do with getting data from the database

 

Link to comment
Share on other sites

Hey Renzo,

 

If I leave database.php as per 2.3.3.1, the login is fine...

 

Also, I can't access server_info.php with upgrade. Getting:

PHP Fatal error: Call to undefined function tep_db_get_server_info() in .../includes/functions/general.php on line 925

 

Which is again database related:

 

$data['mysql'] = array('version' => tep_db_get_server_info()

 

Could our problem be server/mysql related?

 

Here'S my setup

Linux 2.6.18-448.4.1.el5.lve0.8.69.1 MySQL 5.5.33 Apache/2 php 5.3.27 (Zend: 2.3.0)

 

I too have addons, but I never mess with anything on the admin especially login and security.

 

Hi Patrick,

 

I also use the 'database.php' and 'general.php' of osc2.3.3.1 for the moment , untill i discovered the issue....

 

I have 'MySQL 5.5.32 Apache/2 php 5.3.27 (Zend: 2.3.0)', nevertheless, a new install of osc2.3.3.2 is working (full package) as I have testes that.....so it should be one add-on related error. or as stated by Jim we missed something by the upgrade (which I cannot believe)....

 

I also saw another post with this as solution

'Add-Ons that use the mysql_* or mysqli_* functions should use the tep_db_* functions instead. It's an easy update to perform and as Gary stated, conforms to the osCommerce standards'

The error was not related to ours, but I can update my add-ons to see if this works.....one payment add-on (client and admin side), called 'sisow', is using mysql_/myslqi_, so will change that to tep_db_

Link to comment
Share on other sites

Hi Jim,

 

Adding the tep_db_get_server_info to includes/functons/general causes the error, if I leave it has is before update, server_info.php opens fine.

Will double check every patches again as you suggested, has this has got a problem i've caused.

 

Thanks

 

No the error we have is not 'upgrade related'......I just overwrite all my files with the 'osc2.3.3.2 upgrade package' and still keeping the same error.......it must be an add-on related issue which is connected to the admin as the client side is working fine....

Link to comment
Share on other sites

Try adding the following to the bottom of admin/includes/configure.php (or admin/includes/local/configure.php if you're using a custom version):

 

  ini_set('log_errors', true);
 ini_set('error_log', DIR_FS_CATALOG . 'includes/work/errors.txt');

 

Perform an admin login and see if any errors are being reported in your catalog includes/work/errors.txt file.

:heart:, osCommerce

Link to comment
Share on other sites

Try adding the following to the bottom of admin/includes/configure.php (or admin/includes/local/configure.php if you're using a custom version):

 

 ini_set('log_errors', true);
ini_set('error_log', DIR_FS_CATALOG . 'includes/work/errors.txt');

 

Perform an admin login and see if any errors are being reported in your catalog includes/work/errors.txt file.

 

Hello Harald,

 

This is the error that I get:

 

PHP Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in ./includes/functions/database.php on line 140

PHP Warning: mysqli_query() expects parameter 1 to be mysqli, null given in ../includes/functions/database.php on line 43

PHP Warning: mysqli_errno() expects parameter 1 to be mysqli, null given in ...includes/functions/database.php on line 43

PHP Warning: mysqli_error() expects parameter 1 to be mysqli, null given in ../includes/functions/database.php on line 43

 

 

Had clock on computer not up top date.

 

Also, do not know if this helps but if I do not reset cache and cookies in browser, I can use admin without problem except that logoff (upper right bar) redirects to admin/index without logging off.

 

If I logoff before updating without resetting cache and cookies, I can acces admin/login but I get the error above and stay stuck on login page.

 

If I clear cache and cookies, admin/login will loop and not load in browser and error above will load indefinetly.

 

If I do not logoff and do not reset cache/cookies in browser, I can update database.php and use admin without problems without except that I can not logoff most likely until session is over, than get a redirection error in browser.

Link to comment
Share on other sites

We found temporary sql cache problem from mysql to mysqli update in USU 5 Pro but could be solved. I'm affraid of this issue not specialised to admin login. I feel that any server function cache system gives jokes.

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...