WebSite X5Help Center

 
John K.
John K.
User

Database connection - settings for "other" hosting provider  en

Author: John K.
Visited 755, Followers 1, Shared 0  

From the admin panel I can see the database

To be clear from the admin panel I can see the order pending orders and stuff like that ( which do not update because the sending the order to the database fails with a generic error ).

Again, the control panel nothing ever gets to the items ordered pending etc because the by button fails when connecting to a database with a "Generic error" .

If I disable the "send to database" setting in the shopping cart and use the e-mail then the buy button on the shopping cart works (but of course the database never gets updated)

Therefore I believe the problem lies in the fact that I cannot write to the data the X5 database which is triggering the generic error when I hit the buy button (which works perfectly well if I just use e-mail).

So the question is is how do I gain access read/write access to the database so that I can use the buy button using the database.

Thank you and,

Cheers, JK

Posted on the
7 ANSWERS - 1 USEFUL - 1 CORRECT
Claudio D.
Claudio D.
Moderator
Best User of the month IT

it may not have anything to do with your problem, but please check that the PHP parameter is not active on your host
"display error"
Website X5 wants "display error" to be set to NO!

Read more
Posted on the from Claudio D.
John K.
John K.
User
Author

Thank you fdor your reply Claudio!

You sent me down a path that I think leads to the error!

Setting the display error to "Yes" I got the following from the error log file"

[25-Jun-2023 13:32:15 America/Los_Angeles] PHP Warning: count(): Parameter must be an array or an object that implements Countable in C:\inetpub\wwwroot\www.mywebsite.com\FG\res\x5engine.php on line 3142
[25-Jun-2023 13:32:15 America/Los_Angeles] PHP Warning: count(): Parameter must be an array or an object that implements Countable in C:\inetpub\wwwroot\www.mywebsite.com\FG\res\x5engine.php on line 3145
[25-Jun-2023 13:32:15 America/Los_Angeles] PHP Warning: count(): Parameter must be an array or an object that implements Countable in C:\inetpub\wwwroot\www.mywebsite.com\FG\res\x5engine.php on line 3142
[25-Jun-2023 13:32:15 America/Los_Angeles] PHP Warning: count(): Parameter must be an array or an object that implements Countable in C:\inetpub\wwwroot\www.mywebsite.com\FG\res\x5engine.php on line 3145

Apparently, there is a bug in phpmyadmin/libraries/sql.lib.php - a file I cannot find... 

It seems like the code in x5engine.php has this error..

Anybody fixed this yet?

As always, thank you!!

Cheers, JK

Read more
Posted on the from John K.
Daniel W.
Daniel W.
User
Best User of the month EN

According to the error message, an old PHP version is apparently being used, see

-----

Output of the above example in PHP 7.2:

Warning: count(): Parameter must be an array or an object that implements Countable in …

Output of the above example in PHP 8:

Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable ...

>> https://www.php.net/manual/en/function.count.php

-----

Read more
Posted on the from Daniel W.
John K.
John K.
User
Author

Hi Daniel,

Thank you for helping out - it is much appreciated.

I have bounced around on lots of php version and have just gone to 8.27

Here is what I get now:

[25-Jun-2023 17:28:24 America/Los_Angeles] PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in C:\inetpub\wwwroot\mywebsite.com\res\x5engine.php:3142
Stack trace:
#0 C:\inetpub\wwwroot\mywebsite.com\res\x5engine.php(4918): ImCart->saveOrderToDB()
#1 C:\inetpub\wwwroot\mywebsite.com\res\x5engine.php(1955): ImCart->sendOrder()
#2 C:\inetpub\wwwroot\mywebsite.com\res\x5engine.php(1849): CartRouter::{closure}()
#3 C:\inetpub\wwwroot\mywebsite.com\res\x5engine.php(2052): Router->handleRoute()
#4 C:\inetpub\wwwroot\mywebsite.com\cart\x5cart.php(749): CartRouter::handleRoute()
#5 {main}
thrown in C:\inetpub\wwwroot\mywebsite.com\res\x5engine.php on line 3142

I also confirm that email via the contact page is still working..

Standing by and again, thank you!!

Cheers, JK

Read more
Posted on the from John K.
John K.
John K.
User
Author

From what I saw from the array issue there is an error in ( misplaced bracket ) in the array creation 

Read more
Posted on the from John K.
Incomedia
Stefano G.
Incomedia

Hello John

The parameter "display_errors" should be off, not on. I advise first of all you disabled it again.

Then, rollback the PHP version to 8.1 for the moment, not higher.

Once that is done, do a quick test and see if the situation is solved. If it isn't, let me know here

I remain available

Stefano

Read more
Posted on the from Stefano G.