FORUMS


Hello There, Guest! Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MySQL vs. MySQLi (and also PHP7)
#1
Just some more words about the handling of MySQL not only in PHP7 but also for current releases of PHP5.x...

Since Formtools uses the deprecated php-mysql extension and not the more robust and future proof php-mysqli, we've made an attempt using the MySQLConverterTool located at https://github.com/philip/MySQLConverterTool.

All in all, the conversion worked (with some minor warnings), but since we've only made a quick and dirty test run, these results should be taken with a grain of salt.

Has anyone else have experience with such a conversion?

Regards.
Reply
#2
I would be interested to know if you where able to get it running on PHP7 once you completed the conversion. As I had stumbled across that tool as well, and was thinking of giving it a go as well.

Paul

(Dec 9th, 2016, 5:54 AM)HRZ_UniBi Wrote: Just some more words about the handling of MySQL not only in PHP7 but also for current releases of PHP5.x...

Since Formtools uses the deprecated php-mysql extension and not the more robust and future proof php-mysqli, we've made an attempt using the MySQLConverterTool located at https://github.com/philip/MySQLConverterTool.

All in all, the conversion worked (with some minor warnings), but since we've only made a quick and dirty test run, these results should be taken with a grain of salt.

Has anyone else have experience with such a conversion?

Regards.
Reply
#3
Has anyone tried the php7 shim?
https://github.com/dshafik/php7-mysql-shim

Well I just did and it doesn't seem to work even though it appears to be getting included properly. But I could well be doing something else wrong.
Sigh.
Reply
#4
Just tried the converter as well.
Most files seem to be converted to the tool's satisfaction, but formtools still doesn't work: still shows a blank install page.
There were two files with warnings that I don't understand:

Warning: /var/www/html/formtools/install/files/code.php (24/24, 8)
Summary
Found Converted Warnings/Errors File update File backup Length
24 24 8 Yes Yes 22276
Warnings/Errors
Line Message
265 [Line 265] Cannot analyze server parameter to extract host, socket and port! Conversion cannot be performed automatically. You must manually check the result of the conversion.
266 [Line 266]
365 [Line 365] Cannot analyze server parameter to extract host, socket and port! Conversion cannot be performed automatically. You must manually check the result of the conversion. You're calling mysql_connect() twice with the same parameters. We don't know for sure if you want a new connection or reuse the old connection. You must check your code.
375 [Line 375]
518 [Line 518] Cannot analyze server parameter to extract host, socket and port! Conversion cannot be performed automatically. You must manually check the result of the conversion. You're calling mysql_connect() twice with the same parameters. We don't know for sure if you want a new connection or reuse the old connection. You must check your code.
519 [Line 519]
590 [Line 590] Cannot analyze server parameter to extract host, socket and port! Conversion cannot be performed automatically. You must manually check the result of the conversion. You're calling mysql_connect() twice with the same parameters. We don't know for sure if you want a new connection or reuse the old connection. You must check your code.
591 [Line 591]

But the converted code doesn't look to me like it's calling mysql_connect twice:
365: $link = @($GLOBALS["___mysqli_ston"] = mysqli_connect($hostname, $username, $password)) or $db_connection_error = mysqli_error($GLOBALS["___mysqli_ston"]);

By the same token, I have no idea if this should work or not.

And:
Warning: /var/www/html/formtools/global/code/general.php (13/13, 3)
Summary
Found Converted Warnings/Errors File update File backup Length
13 13 3 Yes Yes 57509
Warnings/Errors
Line Message
35 [Line 35] Cannot analyze server parameter to extract host, socket and port! Conversion cannot be performed automatically. You must manually check the result of the conversion.
37 [Line 37] Cannot analyze server parameter to extract host, socket and port! Conversion cannot be performed automatically. You must manually check the result of the conversion.
45 [Line 45]

All these type warnings concern lines like these:
$link = ($GLOBALS["___mysqli_ston"] = mysqli_connect($g_db_hostname, $g_db_username, $g_db_password));
Which looks sort of OK to me but might not be.
At any rate, the thing still isn't working and I look forward to the mysqli powered version.
Reply
#5
OK gave up on php7 and scorched the earth with apt-get purge.
Then installed php5.5 from source, following the installation instructions carefully.
Rebooted.
Voila! It works. Very nice too.
This would appear to be the only path for ubuntu 16 users. Happy to be proved wrong if someone knows another way.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)