php[architect] logo

Want to check out an issue? Sign up to receive a special offer.

The state of PHP 5.3 support

Posted by on June 9, 2010

PHP 5.3 introduced namespaces and anonymous functions to the PHP world, which are surely great innovations for this programming language. For PHP 5.3 to be widely used, however, it needs to be supported by the various operating systems installed on development boxes and servers.

Linux distributions

The Linux environment commonly offers open source software in the form of binary packages available via repositories, being them in the form of .deb or .rpm files. The major distributions compile and bundle every new release of their bundled softwares, and upload the resulting binaries to a public repository which makes upgrading all installed software as simple as typing sudo apt-get update && sudo apt-get upgrade.

PHP is not an exception, and it was usually present in the official repositories of distributions since its 4.x branch. Having PHP 5.3 packages instead of 5.1 or 5.2 in the official repositories is an implicit guarantee of compatibility, and is preferrable to the addition of external sources which may become out-of-date or raise conflicts. The alternative to using binary packages is compiling PHP from source code, a solution that can be time consuming and difficult for a beginner.

In their latest release, some distributions have jumped on the 5.3 bandwagon and now include binary packages of PHP 5.3. Ubuntu Linux is the leader distribution here with PHP 5.3.2, while Fedora Constantine (and Goddard) and openSUSE 11.2 follow with 5.3.0. Ubuntu probably made the right choice by jumping to 5.3 with the release of Lucid Lynx last April. Lucid is a Long Term Support release, whose updates will be provided until 2013 in Desktop Edition and 2015 in Server Edition.

Other distributions are experiencing a slower adoption – Debian and RedHat has PHP 5.3 available only in their testing branches and not in stable releases. If you are stuck with a distro without official packages for PHP 5.3, you may consider installation from an external reliable repository like Zend Server’s one (available for free in its Community Edition).

Windows

On the Windows platform, the situation is a bit different. Windows machines do not employ repositories for distributing software, but in turn there is only one bloodline of Windows to support and not a multitude of distributions.

In fact, binary packages for PHP 5.3 are available on the official windows.php.net website, and independent vendors like WampServer and EasyPHP, which provide the full software stack from Apache to PHP and MySQL, have already upgraded to PHP 5.3.0 in stable releases.

Mac

Mac OS 10.6 Snow Leopard comes with PHP 5.3 bundled, but there are also other options to install a customized version of PHP 5.3, for example to cherry-pick core extensions or to run it on a previous version of Mac OS X.

The simplest solution is to use MacPorts, which simplifies very much the process of compiling and installing open source software on the Mac platform. Currently the MacPorts version of PHP is 5.3.2 and provides separate packages for extensions. Its usage from the command line is similar to Linux’s repositories model. Another option is instead to run a full stack platform like in Linux and Windows cases: MAMP is probably the most popular choice, and it provides both PHP 5.3 and 5.2.

Desktop vs. Server

Desktop machines are much more susceptible to change than their server equivalent, especially than the shared hosting services which made the fortune of PHP all over the world. Despite this, Linux distributions and open source PHP frameworks push for upgrading to PHP 5.3 as soon as possible, while system administrators must maintain a stable environment in their production machines and need to balance the performance and feature improvements with the compatibility breaks.

PHP 4 is sometimes still spotted on production servers now, after six years from the release of PHP 5.0.0 and almost two after its end of life — given that painful experience hopefully PHP 5.3 will be embraced more quickly.


Marco is the keeper of keys and Chief Garbage Collector at Blue Parabola. He can be found on Twitter as @mtabini.
Tags: , , , , , , ,
 

Responses and Pingbacks

I use Fedora at home and for development. On the servers I have CentOS with the Remi repository, which is basically the MySQL and PHP packages from Fedora. This gives me a nice up to date development environment and a stable base for the server while still having a current PHP.

I also try to package as many of the PHP QA tools I use for Fedora, which makes it easy to install them with just one line of “yum”. I have an older post about that on my blog http://christof.damian.net/2010/01/fedora-and-php-qa.html there are more tools available now.

[…] The state of PHP 5.3 support | php|architect […]

You can still install a PHP interpreter into cgi-bin/. This has some shortcomings and is certainly difficult to set up, but still a solution if you’re bound to a substandard hosting provider.
If you don’t need PHP5.3, but just a few features use PHP_Compat or upgradephp.

PHP 5.3 is totally worth it. I haven’t found support to be an issue. Installing on Windows 7 and Ubuntu have not presented any issues, and on my CentOS box, I was able to install PHP 5.3.3 via WHM/cPanel. I find myself using namespaces and anonymous functions the most, partially in preparation for Zend Framework 2.0. PHP 5.3 is a step in the right direction for the language.

Leave a comment

Use the form below to leave a comment: