Forums » Software Installation »
myamiweb still uses the long ago deprecated and now removed MySQL module?
Added by Patrick Goetz over 7 years ago
Whole question is in the subject line. Ubuntu 16.04 (over a year old) doesn't even ship with PHP5.x any more, having switched to PHP7. PHP7 has permanently removed the MySQL module, with MySQIi as the replacement. A quick grep through the ~/myami-3.2/myamiweb PHP code indicates that the mysql PHP module is still in use. I've done a couple of PHP5 to PHP7 conversions. It's generally not that bad, but I'm wondering if this has been fixed in the beta version of myami? Also, does anyone know of any potential gotchas if I just go into the code and make changes like s/mysql_connect/mysqli_connect/g ?
Replies (12)
RE: myamiweb still uses the long ago deprecated and now removed MySQL module? - Added by Anchi Cheng over 7 years ago
This will most likely be o.k. changing from MySQL to MySQLi but the changes will be extensive since the call is both in myamiweb as well as the python subpackage sinedon. What is likely not o.k. is to assume PHP7 will work with the php code we use that is only tested to php 5.6. We simply don't have enough man power to update the code.
You may get lucky that someone else has done it, though.
There is an effort to create Docker for Appion/Leginon. It might be an option for you.
RE: myamiweb still uses the long ago deprecated and now removed MySQL module? - Added by Anchi Cheng over 7 years ago
The problem you may have down the road in installation is more likely from sinedon.
sinedon (the python subpackage that we use to interact with mysql) go through mysql-python to do its thing. It is old and mysql-specific. I tried mysql-connector a while ago but ran into problems with storage engine specific syntax since some of the operation in sinedon only works on MyISAM, not InnoDB. The latter is default now a day.
RE: myamiweb still uses the long ago deprecated and now removed MySQL module? - Added by Patrick Goetz over 7 years ago
The problem you may have down the road in installation is more likely from sinedon.
Hi -
I'm not sure I follow this. Does sinedon use PHP as well? This seems like a slightly different problem, from your description. I tried grep'ing for some of the offending PHP MySQL functions in the sinedon directory and couldn't find anything.
RE: myamiweb still uses the long ago deprecated and now removed MySQL module? - Added by Anchi Cheng over 7 years ago
It is not php, but the database is the back end of everything in Leginon/Appion. A change from MySQL to MySQLi is what you propose to change.
The processing server part of Leginon/Appion talks to the database through python scripting as much as myamiweb through php scripting.
mysql-python is a third-party package, so is mysql-connector. Both of them establish connection to MySQL database so that query written in python syntax can be sent to it. From what I read, the latter can be used with MySQLi. I don't know about the former.
If these confuse you too much, it may not be a good idea to do what you are proposing because you will open a can of worm and we will not be able to help you easily.
RE: myamiweb still uses the long ago deprecated and now removed MySQL module? - Added by Patrick Goetz over 7 years ago
Hi -
No, I'm not confused. The database is still MySQL (MariaDB would likely work just as well, as it's syntax-compatible with MySQL), mysqli is a PHP module (http://php.net/manual/en/book.mysqli.php), just like the now removed mysql module. These are independent of the underlying database (assuming compatible API -- like I said, MariaDB would likely work just as well). None of this has anything whatsoever to do with python, which has it's own module for connecting to mysql.
At least for myamiweb, I'm pretty sure I can make the update from mysql (the PHP module, NOT the database) to mysqli in less than 30 minutes. The mysql module was already deprecated in PHP 5.5, which came out years ago. For the most part, making the change is pretty straight forward; e.g. mysql_connect() --> mysqli_connect().
If I get it working, I can just pass the changes back to you. I was just wondering if there is some deep reason that this hasn't been updated, and it just sounds like no one has spent any time on it.
RE: myamiweb still uses the long ago deprecated and now removed MySQL module? - Added by Anchi Cheng over 7 years ago
I am glad that you have worked it out. That is good news for us, too.
RE: myamiweb still uses the long ago deprecated and now removed MySQL module? - Added by Patrick Goetz over 7 years ago
BTW, I went to fix some simple and obvious errors on the Database Server Installation page on the wiki, but when I go to edit:
\{{include(appion:Database Server Installation Shared)\}}
There's nothing actually there. Is this page editable?
RE: myamiweb still uses the long ago deprecated and now removed MySQL module? - Added by Sargis Dallakyan over 7 years ago
Patrick Goetz wrote:
BTW, I went to fix some simple and obvious errors on the Database Server Installation page on the wiki, but when I go to edit:
\{{include(appion:Database Server Installation Shared)\}}
There's nothing actually there. Is this page editable?
Yes, you can edit it here http://emg.nysbc.org/projects/appion/wiki/Database_Server_Installation_Shared
I click on Index by title in the wiki and then browser search for the page. Thanks.
RE: myamiweb still uses the long ago deprecated and now removed MySQL module? - Added by Anchi Cheng over 7 years ago
Patrick,
The pages can only be edited with developer level access. If you are willing to contribute, we will be happy to elevate you.
RE: myamiweb still uses the long ago deprecated and now removed MySQL module? - Added by Anchi Cheng over 7 years ago
Take it back. You can edit wiki as reporter. Somehow you were not set to any level of privilege when we granted your registration. I just amended that.
RE: myamiweb still uses the long ago deprecated and now removed MySQL module? - Added by Patrick Goetz over 7 years ago
Thank you. Still, to edit I need to know where to find this page.
RE: myamiweb still uses the long ago deprecated and now removed MySQL module? - Added by Anchi Cheng over 7 years ago
The clue is in Sargis's post.