The official announce of PHP 5.3.0
Read carefully this announce from PHP.net and its links :
The PHP development team is proud to announce the immediate release of PHP 5.3.0. This release is a major improvement in the 5.X series, which includes a large number of new features and bug fixes.
Some of the key new features include: namespaces, late static binding, closures, optional garbage collection for cyclic references, new extensions (like ext/phar, ext/intl and ext/fileinfo), over 140 bug fixes and much more.
For users upgrading from PHP 5.2 there is a migration guide available here, detailing the changes between those releases and PHP 5.3.0.
Further details about the PHP 5.3.0 release can be found in the release announcement, and the full list of changes are available in the ChangeLog.
This is a great news and a big step for PHP, that gets cleaner and speedier (for example, read this benchmark of ezPublish performance boost with PHP 5.3.0).
In my (sysadmin) opinion, the best features are :
- ext/phar to bundle complete application in an archive
- MySQL native driver that avoid the libmysqlclient dependency, increases the overall performances and adds great features (real persistance, asynchronous queries)
- dirty and unsafe features (register_globals, safe_mode, magic_quotes*) removal
[caption id=“attachment_250” align=“aligncenter” width=“300” caption=“The elePHPants march (credit : DragonBe)”]
[/caption]
Be careful!
Depending of your applications, PHP 5.3 may not be fully compatible with 5.2 out of the box :
- many and many fonctions and features are deprecated or changed
- some extensions (ming, ncurses…) moved to PECL, others (mime_magic, mhash) are just emulated
- some bugs still exists and should be fixed with PHP 5.3.1
For example, I experienced some strange behaviour with Wordpress, Sweetcron or Roundcube and I had to patch them.
Please read the migration guide very carefully before going further!
What are the changes from Dotdeb?
Ok, now that you read the Changelog and the migration guide, now that you know how to modify your script to migrate to PHP 5.3, you have to be aware of some changes introduced by Dotdeb and their consequences :
- The migration from libmysqlclient to MySQL native driver is great in terms of performance and memory but have one restriction : it necessitates the use of MySQL 4.1’s newer 41-byte password format. Continued use of the old 16-byte passwords will cause mysql_connect() and similar functions to emit the error, “mysqlnd cannot connect to MySQL 4.1+ using old authentication.”. Please check your MySQL passwords in
mysql.userbefore upgrading! - The
mail_extra_headersthat allowed to insert the script’s name in the sent mails has been included in the core of PHP and the ini variable isnow mail.x_header - php5-mhash, since its functions are emulated by ext/hash , disappeared and is now included in the core of PHP.
- php5-ming moved to PECL and is not packaged anymore
- The Suhosin patch and the associated extension are not available yet (that’s what justifies the preview status)
- All the PECL extension are not built yet. They will be as soon as the preview phase is over.
- Enchant support has been included as bonus feature :)
How to install?
As they’re just preview packages, the PHP 5.3.0-final ones are still on a separate repository. To install them, just add these temporary entries in your /etc/apt/sources.list.
deb http://php53.dotdeb.org stable all
deb-src http://php53.dotdeb.org stable all
Now launch your favorite commands ( apt-get update && apt-get upgrade) to upgrade your box and enjoy!
For your information, I do NOT intend to publish PHP>=5.3.0 packages for Debian Etch, it would mean too much work to get clean packages… PHP 5.2.10 (once fixed) will be last version available for Etch from Dotdeb. Then, you’re strongly encouraged to migrate to Debian Lenny if you want to take profit from 5.3.0.
Last but not least : thank you!
Thanks for using Dotdeb, for your useful reports and for your suggestions. Altough I’m doing my best to bring you the best new features of PHP the stable way, my work is not perfect and your help is really appreciated when things go bad.
So, no matter WHAT I do, I cannot install these packages because of dependencies that probably don’t matter anyway! How can I override this without removing all the problematic packages?
php5-xsl: Depends: php5-common (= 5.2.6.dfsg.1-1+lenny3) but 5.3.0-0.dotdeb.6 is to be installed. php5-sqlite: Depends: php5-common (= 5.2.6.dfsg.1-1+lenny3) but 5.3.0-0.dotdeb.6 is to be installed. php5-snmp: Depends: php5-common (= 5.2.6.dfsg.1-1+lenny3) but 5.3.0-0.dotdeb.6 is to be installed. php5-gd: Depends: php5-common (= 5.2.6.dfsg.1-1+lenny3) but 5.3.0-0.dotdeb.6 is to be installed. php5-curl: Depends: php5-common (= 5.2.6.dfsg.1-1+lenny3) but 5.3.0-0.dotdeb.6 is to be installed. php5-pspell: Depends: php5-common (= 5.2.6.dfsg.1-1+lenny3) but 5.3.0-0.dotdeb.6 is to be installed. php5-xmlrpc: Depends: php5-common (= 5.2.6.dfsg.1-1+lenny3) but 5.3.0-0.dotdeb.6 is to be installed. php5-mcrypt: Depends: php5-common (= 5.2.6.dfsg.1-1+lenny3) but 5.3.0-0.dotdeb.6 is to be installed. php5-mysql: Depends: php5-common (= 5.2.6.dfsg.1-1+lenny3) but 5.3.0-0.dotdeb.6 is to be installed. php5-cli: Depends: php5-common (= 5.2.6.dfsg.1-1+lenny3) but 5.3.0-0.dotdeb.6 is to be installed.
The following packages will be REMOVED: libmhash2{u} php5-mhash{a}
I wonder if upgrading to this version is even worth it. If the php developers can’t be backwards compatible it makes it tough on us admin to keep with the changes.
I may just prevent 5.3 from being mirrored if that is the case.
trying to install 5.3 on my ubuntu 9.04 server machien, but errors occur:
root@ubuntu:~# apt-get install php5-dev Reading package lists… Done Building dependency tree Reading state information… Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:
The following packages have unmet dependencies: php5-dev: Conflicts: libtool (>= 2.2) but 2.2.6a-1ubuntu1 is to be installed E: Broken packages
If you, like me, cannot install php5-mcrypt on Ubuntu due to: php5-mcrypt: Depends: libltdl3 (>= 1.5.2-2) but it is not installable
You can work around it by installing packages manually from debian: http://packages.debian.org/lenny/amd64/libltdl3/download http://packages.debian.org/lenny/amd64/libltdl3-dev/download
I don’t know if there is a smarter way to satisfy this dependency, but this workaround at least got me back doing real work.
When i try to install the php5-dev, it tell me that i must uninstall the gnome-common first loooooooooool
i was not able to install the .deb, i just compile it from php.net
btw, thanks ^^
I tried to pecl install apc but apparently it’s broken for php5.3 as reported here: http://pecl.php.net/bugs/bug.php?id=16078
Looks like for me it’s not yet migration time ^_^
Another weird behaviour… apache vhost defines date.timezone:
php_value date.timezone “Europe/Paris”
and PHP randomly throws warnings:
[Fri Jul 10 02:06:21 2009] [error] [client 123.125.64.38] PHP Warning: include(): open_basedir restriction in effect. File(/home/mickael/v2.desfrenes.com/trunk/bootstrap.php) is not within the allowed path(s): (Europe/Paris) in /home/mickael/v2.desfrenes.com/trunk/docroot/index.php on line 4
How can date.timezone be used as a path for open_basedir ? O_ô
@desfresnes : How did you define your vhost? In a plaintext file or using a mass-virtual-hosting backend (mod_vhs or so on…)?
I had this issue with mod_vhs, showing bad memory allocation but I didn’t have time to debug it yet. It seems that the changes in open_basedir, realpath() and timezone lead to this kind of problem.
I’m still crawling bugs.php.net…
vhost is defined in a plaintext file, in /etc/apache2/sites-available/.
Right now the site is unavailable. I changed nothing and this morning the open_basedir has changed:
sd-14043:/home/mickael# tail -f /var/log/apache2/error.log [Fri Jul 10 07:33:47 2009] [error] [client 90.62.171.44] PHP Warning: include(): Failed opening ‘../bootstrap.php’ for inclusion (include_path=’.:/usr/share/php:/usr/share/pear’) in /home/mickael/v2.desfrenes.com/trunk/docroot/index.php on line 4
sorry, here’s the open_basedir:
[Fri Jul 10 07:39:59 2009] [error] [client 90.62.171.44] PHP Warning: include(): open_basedir restriction in effect. File(/home/mickael/v2.desfrenes.com/trunk/bootstrap.php) is not within the allowed path(s): (\xe0<\xb5) in /home/mickael/v2.desfrenes.com/trunk/docroot/index.php on line 4
(\xe0<\xb5) ??? not much better than (Europe/Paris)
Is there any chance you can include the embed SAPI in the php5-dev package or create another package for php5-embed.
I can build PHP on my own to get the embed SAPI, but for making the code portable, it would be nice for others to be able to apt-get install php5-embed and them build my app.
Is the 64bit version compiled with “CFLAGS=’-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64’”?
See http://de2.php.net/manual/en/intro.filesystem.php
For example for large file uploads…
Please, add the oldstable version of php 5.3, I cant install on my debian 4: apt-get install php5-cli
php5-cli: Depends: libc6 (>= 2.7-1) but 2.3.6.ds1-13etch9+b1 is to be installed Depends: libdb4.6 but it is not installable Depends: libicu38 (>= 3.8-5) but it is not installable Depends: libkrb53 (>= 1.6.dfsg.2) but 1.4.4-7etch7 is to be installed Depends: libncurses5 (>= 5.6+20071006-3) but 5.5-5 is to be installed Depends: libssl0.9.8 (>= 0.9.8f-5) but 0.9.8c-4etch5 is to be installed Depends: libxml2 (>= 2.6.28) but 2.6.27.dfsg-6 is to be installed Depends: php5-common (= 5.3.0-0.dotdeb.6) but 5.2.8-0.dotdeb.1 is to be installed E: Broken packages
Even after doing the suggested update/upgrade I’m still presented with a bunch of solutions, most involve removing PHP. The least egregious is:
The following packages have been kept back: php-pear php5-dev
The following NEW packages will be installed: libicu38{a}
The following packages will be REMOVED: djvulibre-desktop{u} ghostscript{u} gs-common{u} gsfonts{u} libcroco3{u} libcupsimage2{u} libdjvulibre21{u} libgd2-xpm{u} libgraphviz4{u} libgs8{u} libgsf-1-114{u} libgsf-1-common{u} libilmbase6{u} libjasper1{u} libmagick10{u} libmhash2{u} libopenexr6{u} libpaper-utils{u} libpaper1{u} librsvg2-2{u} libwmf0.2-7{u} php5-imagick{a} php5-memcache{a} php5-mhash{a} psfontmgr{u} The following packages will be upgraded: libapache2-mod-php5 php5 php5-cli php5-common php5-curl php5-gd php5-mcrypt php5-mysql php5-pspell php5-snmp php5-sqlite php5-xmlrpc php5-xsl
How can I just upgrade PHP and ignore the dependencies?
@Austin B. : Please use a tool such as dselect or aptitude to know which dependency causes these removals.
About php5-imagick and php5-memcache, they’re not compatible with php 5.2.10 yet. They will be in the final release. About php5-mhash, it is obsolete because of the incluusion of an emulated mhash in the PHP’s core.
If you really don’t succeed in resolving your dependencies, please send me at gui_at_php_dot_net :
Hi
What is the expected release date of the final release?
I’m waiting to install it to new server so it can go to colocation ;)
@Bostjan : if you don’t need the suhosin (patch + extension), install those packages, they’ll fit your needs. They won’t be different from the suhosin-enabled ones.
If not, try to guess the Suhosin patch’s release date.
I’ve recently install php5-xdebug from dotdeb repository. It gave me warning “xdebug must be loaded as a zend extension in unknown on line 0”. It will be nice to update /etc/php/conf.d/xdebug.ini from
extension=xdebug.so
to
zend_extension=’/absolute/path/to/xdebug.so'
Also there was malformed comment before this line.
With best regards, Sergey Galkin
Regarding Sergey Galkins comment, last line:
PHP Deprecated: Comments starting with ‘#’ are deprecated in /etc/php5/cli/conf.d/memcache.ini on line 1 in Unknown on line 0
PHP Deprecated: Comments starting with ‘#’ are deprecated in /etc/php5/cli/conf.d/suhosin.ini on line 1 in Unknown on line 0
PHP Deprecated: Comments starting with ‘#’ are deprecated in /etc/php5/cli/conf.d/xdebug.ini on line 1 in Unknown on line 0
@Laph: There’s no way to know the xcache version without installing the package.
I’m thinking about changing the version numbering scheme to reflect the extensions’ version without breaking binary compatibility (xcache for 5.2.10 is not the same as xcache for 5.3.0, for example).
for some reason, when i use apt-get install php5 ill get 5.2.6 (which is the latest stable in lenny) but if i use aptitude i get your 5.3?
Why is that?
@Thomas : mysqlnd has its own release number that doesn’t depend on the installed MySQL libraries, since mysqlnd is not linked against libmysqlclient :
http://bazaar.launchpad.net/%7Eandrey-mysql/php-mysqlnd/trunk/annotate/head%3A/mysqlnd/mysqlnd.h
More info about mysqlnd : http://dev.mysql.com/downloads/connector/php-mysqlnd/
@Jay : it’s not planned, but you can build a package by yourself using this method :
/2008/09/25/how-to-package-php-extensions-by-yourself/
My compliments, nice to see 5.3 already available here!
But… I have some problems upgrading. I use Debian Lenny, all packages updated to the newest versions before adding the php53 sources. I use apache2-mpm-worker (in stead of prefork) because of its threading and better performance, together with DotDeb’s PHP5 via FastCGI. The best performance I’ve ever had…!
But while upgrading via ‘apt-get update && apt-get dist-upgrade’, it asks to REMOVE apache2-mpm-worker and to install apache2-mpm-prefork and libapache2-mod-php5! Of course that’s not what I want…
Did I something wrong? How can I solve this?
php5.3 packages for Debian are not equipped with GD-Lib and the DIO-Lib does not fit.
Unfortunately it’s impossible to remove the package, though one cannot downgrade to original debian 5.2.6- …
please give advice, what to do
Installation of php5-gd was not possible, until I removed ALL PHP-Stuff (excluding the ini-file) from the Host in the following order:
apache2ctl stop apt-get remove libapache2-mod-php5 apt-get autoremove php5
setting the sources apt-get update apt-get upgrade apt-get install php5 apt-get install php5-gd apt-get install php5-cli apt-get install php5-cgi apache2ctl start
Now the Server is working with PHP Version 5.2.11-0.dotdeb.1 and all the buggy stuff has vanished, missing functions (imagerotate()) are included, etc.
But I had to remove first the old versions!
Hi,
i tied to rebuild those packages for Ubuntu Jaunty, but can’t find the sources of the packages from http://php53.dotdeb.org/dists/lenny/php5-pecl/binary-i386/ anywhere. Please give me a hint.
Bye FB
@Foobar : just use this method :
/2008/09/25/how-to-package-php-extensions-by-yourself/
I just installed the PHP 5.3.0 Packages including libapache on a virginal Debian Lenny and got an error message:
apache2: apr_sockaddr_info_get() failed for debian5.3
What’s the reason? Any advice?
Thanks, Tom
Ok ok, it was my falut…
the hostname in /etc/hostname must have a resolution in /etc/hosts
My hostname still was wrong: debian5.3 while the resolution already was set to: debian5.0.3
Now ist works fine. :-)
This version has a bug:
http://bugs.php.net/bug.php?id=48697&edit=1
I just hit apt-get upgrade and suddenly all my capitalized strings come out funny, took forever to figure out what it was.
If you use parse_str, it will erroneously reset your mb_internal_encoding to ISO-8859-1. If you have code using mbstring functions and the parse_str function you may want to consider this before installing.
So… any chance of a fix for this? :-D
Just curious, can anyone tell me when this package will be available in the dotdeb.org main repository?
Thanks
Hi Admin, When should we expect 5.3.1 ? Another question would you recommend your packages for a production server for a person new to linux?
Thanks, Greg