How (and when) to move users to mysqli and PDO_MYSQL?

An important discussion on the PHP "internals" development mailing list is taking place. It's one that you should take some note of. It concerns the next step in transitioning PHP applications away from the very old mysql extension and towards adopting the much better mysqli extension or PDO_MYSQL driver for PDO. This would allow the mysql extension to, at some as-yet undetermined time in the future, be removed. Both mysqli and PDO_MYSQL have been around for many years, and have various advantages: http://php.net/manual/en/mysqlinfo.api.choosing.php

The initial RFC for this next step is at https://wiki.php.net/rfc/mysql_deprecation I would expect the RFC to change substantially based on current discussion. The crux of that discussion is the timing of the next step of deprecation. There is also discussion of the carrot approach (showing users the benfits of moving), and stick approach (displaying warnings when the mysql extension is used). As always, there is a lot of guesswork going on as to what MySQL APIs are in current use by PHP applications, how those applications are deployed, and what their upgrade cycle is. This is where you can add your weight to the discussion - and also help by spreading the word to move to mysqli or PDO_MYSQL. An example of such a 'carrot' is the excellent summary at Ulf Wendel's blog: http://blog.ulf-wendel.de/2012/php-mysql-why-to-upgrade-extmysql/

I want to repeat that no time frame for the eventual removal of the mysql extension is set. I expect it to be some years away.

Comments:

I don't think it's a matter of migrating the users, rather than the companies. There is a lot of legacy code out there that just doesn't get assigned the right priority to be refactored, or it is simply not being updated on the premises that it's working as intended and development is no longer needed on it (e.g Internal tools).

On the user side, I am confident that new projects starting now are in fact using the newer extensions and that everyone understands that at some point the old one will just have to go.

Posted by Stelian Mocanita on November 26, 2012 at 02:28 PM PST #

One of the discussion points has been whether such legacy sites are even updating PHP (which they should, for security & stability reasons) and hence whether any deprecation efforts will even be noticed.

Posted by Chris Jones on November 26, 2012 at 04:19 PM PST #

carrot approach is the way to go, much higher volume of quick adoption that way I think... Gotta show the goods slowly to give time to transition and embrace

Posted by Matt @ Firebox on November 27, 2012 at 04:35 PM PST #

The mysqli extension has been around since 2003/2004. Is that enough carrot?

Posted by Christopher Jones on November 27, 2012 at 05:01 PM PST #

Post a Comment:
Comments are closed for this entry.
About

Tourists looking out over an Opal mine
I'm a Product Manager in Server Technologies, working on scripting languages and developer-access.
Email: christopher.jones@oracle.com
Twitter: http://twitter.com/ghrd
Book: Free PHP Oracle book
Download: PHP Linux RPMs with the OCI8 extension
Links: OTN PHP Developer Center

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today