14 Dez

Heads Up: PHP deprecates mysql extension in 5.5.

In a recent developer vote, the php project decided to deprecate the mysql extension in PHP 5.5 and finally remove it from the main PHP project. It may or may not be available for a longer period as a PECL extension.

The mysql extension has long been superseded by two more powerful extensions, PDO/Mysql and mysqli (improved). For years, the older extension has not received any new features and the developers kept it around just to keep compatibility with old code. Framework and application developers are now urged to update their code to use one of the alternative mysql APIs. There are a lot of old code snippets and tutorials around which describe the old API. Eventually, this code will begin to throw warnings and finally stop to work.

Developers discussed the impact of this move on end users. While it might be shocking to see hordes of old installations break just because the hoster updates his PHP version, there is no need to panic. Most hosters have not even upgraded to the recent PHP 5.4 release and it might be years to go until PHP 5.6 finally hits enterprise distributions like SLES or RHEL. Additionally, distributors and hosters might opt to provide the PECL version of the mysql extension for backward compatibility. There is enough time left for developers and end users to react on the coming change.

More on the deprecation vote

Eliasse Diaite sagt:

Hi gentleman,

Your article gives me the opportunity to draw the attention of the maintainers of two repositories of the OBS. Apache has been upgraded to the version 2.3 in its repository while PHP and its extensions and applications repositories seem to be built again the version 2.2 of Apache in the OBS.

Could you help contacting the maintainers of those repositories so that they collaborate and synchronize their builds at least for the Factory branches and deliver the latest versions of Apache and PHP.

Thanks a lot for publishing this paper about the future deprecation of the mysql extension. Have a lot of fun…

openSUSE Linux is unbreakable.

Ralf sagt:

Hi, before I contact the repo maintainer, which build of php5/extensions are you referring to?

It seems like https://build.opensuse.org/package/view_file?expand=1&file=php5.spec&package=php5&project=server%3Aphp is building against the apache2-devel package for your distribution. If this is factory, it should be the latest apache. If this is 12.1, it should build against the distribution native apache2-devel version, which may be 2.2

They might need to add an apache-opensuse_12.2 repository combining 12.2 with latest apache and php.

If you want to contact the maintainers on this, a good way is to subscribe to the opensuse-packaging list.

Arief sagt:

Аз затова ползвам услугите на blogspot не ми се налага да се грижа за хостинг.. Така и така не ми остава време да пиша в блога, поне да отметна грижата за работещ и константно защитен сървър на някой друг

Pi.Ko. sagt:

and how will be then used mysql?

Ralf sagt:

use mysqli or PDO::Mysql instead of the mysql_connect etc functions.