Jump to content

php db call: fetch_all, not supported by cpanel hosts?


Recommended Posts

Hi

After upgrading to 1.6.0.11 we received the php error: 

PHP Fatal error: Call to undefined method mysqli_result::fetch_all() in /home/mydomain/public_html/myshop/classes/db/DbMySQLi.php on line 112

 

After raising a ticket to our host asking why "fetch_all" was disabled we received following answer:

 

We have not disabled it but from researching the fetch_all command also needs mysqlnd installed and that is not avaliable on cpanel servers because it breaks older scripts that use short passwords. 
So the developer needs to fix that call if he intends his software to work with any cpanel servers. 

He can use the fetch_assoc() call instead which will work or I suppose if you can edit his code you can replace the fetch_all with the fetch_assoc()

 

I tried to simply change the call to fetch_assoc(), but this was no luck. The error message changed to:

 

PHP Warning: mysqli_result::fetch_assoc() expects exactly 0 parameters, 1 given in /home/mydomain/public_html/myshop/classes/db/DbMySQLi.php on line 112

 

We just hope this is recognized problem so maybe a quick fix would be possible?

 

Many thanks for any advice how to fix it.

Link to comment
Share on other sites

Realized that fetch_all was introduced in 1.6.0.11.

 

So I tried to pickup the module DbMySQLi.php from 1.6.0.9 and mix it in the 1.6.0.11 db folder, but this was no luck either.

Received following error:

 

PHP Fatal error: Class DbMySQLiCore contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (DbCore::getAll) in /home/mydomain/public_html/mystore/classes/db/DbMySQLi.php on line 251

 

Any help on this is appreciated

Link to comment
Share on other sites

Trying to further isolate the problem, I made a similar upgrade on a test site on the same server... and that works without any problem! So on the same server I have a test site on 1.6.0.11 (on another domain) that works but the autoupgraded live site on 1.6.0.11 generates this fatal php error!!!

 

My conclusion is that the host is actually supporting the "fetch_all" call, but our problem remains....

 

Someone have a clue what could be wrong? I read the error log in the autoupgrade module to check if the upgrading process recorded some errors, but the first error in the log file is the fatal php error that is thrown after the upgrade process has successfully ended and we try to enter the site...

 

Is there someone familiar with the php/MySQL logic that could give a hint why the fatal php error is generated?

Link to comment
Share on other sites

Did a clean install of a test site in the same domain as the live shop resides, and the result was that the php fatal error is still there!!!

 

Suspect that we have a problem with an outdated php.ini file, will ask my host to remove all php.ini overrides.

 

Will report back if this solves the problem.

Link to comment
Share on other sites

Solved!

By setting register_globals = Off and magic_quotes_gpc = Off in the php.ini file the problem is solved.

Seems like php does not load correctly if those parameters is set to On. A bit rough behaviour in my mind...

 

If this is so important then maybe the 1-click-upgrade process should make a check that register_globals and magic qoutes are both Off?

 

Anyway, now it works.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...