PHP 5.4.0 preview packages

After many months of active development, PHP 5.4.0 is now generally available :

The PHP development team is proud to announce the immediate release of PHP 5.4.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: traitsa shortened array syntaxa built-in webserver for testing purposes and more. PHP 5.4.0 significantly improves performance, memory footprint and fixes over 100 bugs.
For users upgrading from PHP 5.3 there is a migration guide available here, detailing the changes between those releases and PHP 5.4.0.
Further details about the PHP 5.4.0 release can be found in the release announcement, and the full list of changes are available in the ChangeLog.

On the Dotdeb side (thanks to Debian developers’ preliminary work), I’m proud to announce that preview packages of PHP 5.4.0 are now available for Debian 6.0 “Squeeze” on amd64 and i386 architectures. You are invited to test them on development servers, but please don’t install them on production servers yet : the Suhosin patch has not been applied, some extensions are not fully compatible and the following ones are missing…

  • php5-ffmpeg
  • php5-pinba
  • php5-suhosin
  • php5-xcache
  • php5-xdebug
  • php5-xhprof

Don’t worry, production-ready PHP 5.4 packages will be available in some few weeks, after the Suhosin patch and the missing extensions are published.

To avoid your servers to be accidentally upgraded from PHP 5.3 to PHP 5.4 without compatibility validation, the PHP 5.4 packages are available on a separate path. To install them, you’ll have to add this line to your /etc/apt/sources.list first (you can also use any Dotdeb mirror once they’re synchronized) :

deb squeeze-php54 all

The main changes in the packages :

  • if you need MySQL-related functions, you can now choose between the (libmysqlclient-linked) php5-mysql package and the (MySQL native – and better – driver-linked) php5-mysqlnd one
  • PHP extensions config files are now migrated to /etc/php5/mods-available/. Files in /etc/php5/conf.d/ are now just symlinks to them. Therefore, you can activate PHP extensions by using php5enmod/php5dismod.

I hope you’ll enjoy this new packages. Any feedback or donation is highly appreciated.

37 replies on “PHP 5.4.0 preview packages”

I thought there was a general decision Debian to no longer package PHP with suhosin?

@Dave : thanks for this feedback. As said in the blog post, some extensions are not fully compatible with PHP 5.4. I’ll take a look at the git/svn versions and I’ll update the packages in the next few days.

Is there a possibility you create a branch with no suhosin, my app is very stable with php alone, with apc too, but apache crash with suhosin and suhosin won’t handle some internal stream…

@Seza : Suhosin is not included in the PHP 5.4.0 packages yet, but it will be once it’s available.
The packaging scripts will allow you to easily build your own Suhosin-free Debian package, I’ll post a note about it soon.
Anyway, did you try to isolate the problematic portion of your code? What are the errors raised by Suhosin? Did you uninstall the php5-suhosin extension to lower its effect? Did you try to tweak it according to your needs?

Investigate is certainly a big word but I tried to figure out what’s going on.

I’m not good enough to make ‘strace’ and things like that to find where bad karma with suhosin coming from.
I’ll tried to isolate portion of code that, crashes arrives after few hours of work, app start to hangs a little before crash, and I can’t reproduce the way the crash becomes. (No helpful logs by the way).
Actually I run with suhosin in simulation mode. Because of stream issue, since 5.3.8, there is noway to configure suhosin stream whitelist/blacklist and make things working. Even in simulation mode, suhosin continue to alert me about streams… it’s very annoying to work like that.
Even in simulation, app crashed again so I removed APC… This is not helpful, but it’s a production server, I can’t play so much on it and permit more downtime to find what’s the problem and I can’t reproduce the problem on the same version of php and apc on my dev machine (osx).

As you can see, it’s not simple (for me). If you provide a methods to make own package, that’s enough for me. Thank you. You’re making great work anyway.

@Seza : please first unintall php5-suhosin to remove most of Suhosin’s protection (it will be easier than rebuilding all the needed php5 packages). It’s just a recommended package. Tell me if it solves your issues.

After installing PHP 5.4 gzopen does not exist.

The results with var_dump(get_extension_funcs(‘zlib’));

array(25) { [0]=> string(10) “readgzfile” [1]=> string(8) “gzrewind” [2]=> string(7) “gzclose” [3]=> string(5) “gzeof” [4]=> string(6) “gzgetc” [5]=> string(6) “gzgets” [6]=> string(7) “gzgetss” [7]=> string(6) “gzread” [8]=> string(8) “gzopen64” [9]=> string(10) “gzpassthru” [10]=> string(8) “gzseek64” [11]=> string(8) “gztell64” [12]=> string(7) “gzwrite” [13]=> string(6) “gzputs” [14]=> string(6) “gzfile” [15]=> string(10) “gzcompress” [16]=> string(12) “gzuncompress” [17]=> string(9) “gzdeflate” [18]=> string(9) “gzinflate” [19]=> string(8) “gzencode” [20]=> string(8) “gzdecode” [21]=> string(11) “zlib_encode” [22]=> string(11) “zlib_decode” [23]=> string(20) “zlib_get_coding_type” [24]=> string(12) “ob_gzhandler” }

Can you help me, please.

@Seza : not exactly. php5-apc requires php5-common, that *recommends* php5-suhosin. Then, you can install php5-apc without php5-suhosin. Use deselect, synaptic or aptitude to choose your package precisely or set the “APT::Install-Recommends” apt setting to false.

I added your repo to my sources.list; but get the following error:

W: GPG error: squeeze-php54 Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY E9C74FEEA2098A6E

Could you please help me out? 🙂

Will it be possible to stick with php 5.3 or will 5.4 be moved into the main repo?

I know the idea of dotdeb is to have the latest, I’m just a little uneasy about upgrading to 5.4.x series yet. And I don’t trust any other repos for upgrades to say 5.3.11 if it comes out.

Using the PHP 5.4 package, perl-regex matching with ‘u’ option like preg_match(‘/$regex/u’, $subject) doesn’t work.
It works for the PHP 5.3 package by dotdeb.
The linked libpcre doesn’t support the unicode property ?

Thanks for providing latest builds! Though I have a question: if I use “squeeze-php54” path I get PHP 5.4 but not MySQL 5.5 in package lists, how do I get both?

I installed php-gettext and manually added to the enabled extensions, because no conf.d file was created.
According to phpinfo(), gettext support is enabled, but PHP keeps telling me that __() is an unknown function.

Is this a known issue or did I do something wrong?

Thanks 🙂

php5-mysqlnd totally wrecked my system. It fails to install AND fails to uninstall (it gets stuck in some intermediate state where it’s neither installed nor not-installed) AND blocks the installation of php5-mysql (which first tries to uninstall php5-mysqlnd, which fails). Did anyone experience the same issue (and found a fix)?

Here are some outputs:

# apt-get install php5-mysqlnd
Reading package lists… Done
Building dependency tree
Reading state information… Done
php5-mysqlnd is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

=> claims it’s installed (but it isn’t)

# apt-get remove php5-mysqlnd
Removing php5-mysqlnd …
/usr/sbin/php5dismod: line 108: FOUND: unbound variable
dpkg: error processing php5-mysqlnd (–remove):
subprocess installed pre-removal script returned error exit status 1
configured to not write apport reports
Processing triggers for libapache2-mod-php5 …
Reloading web server config: apache2.
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

=> can’t be uninstalled

# apt-get install php5-mysql
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
libmysqlclient16 mysql-common
The following packages will be REMOVED:
The following NEW packages will be installed:
libmysqlclient16 mysql-common php5-mysql
0 upgraded, 3 newly installed, 1 to remove and 0 not upgraded.
Need to get 0 B/2,095 kB of archives.
After this operation, 4,350 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database … 41511 files and directories currently installed.)
Removing php5-mysqlnd …
/usr/sbin/php5dismod: line 108: FOUND: unbound variable
dpkg: error processing php5-mysqlnd (–remove):
subprocess installed pre-removal script returned error exit status 1
configured to not write apport reports
Processing triggers for libapache2-mod-php5 …
Reloading web server config: apache2.
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

=> prevents me from installing php5-mysql

I tried apt-get autoclean, autoremove, and tons of such stuff, no luck. I think things went bad when I tried to install php5-mysqlnd over php5-mysql, where this bad thing happened and stopped the installation somewhat in the middle:

ucfr: Attempt from package php5-mysqlnd to take /etc/php5/mods-available/mysql.ini away from package php5-mysql
ucfr: Aborting.

(Note that I do get those lines even while php5-mysql seems fully uninstalled)

Totally stuck here with a now MySQL-less server… any idea on how to fix this without reinstalling the whole server (which would be quite a major PITA)?

Thanks! Actually in my case I had to edit php5-mysqlnd.prerm 😉
I still can’t install php5-mysqlnd, but php5-mysql works fine.

FYI: Encountered the same issue today in Debian testing, lost to many hours to count them. Now I ended up adding exit 0 in pre + post install script and manually copy over ini files as I can not install any of them any more, as they both ouput errors when one or the other tries to take ownership of the mods-available files (even if I applied the fix for FOUND=0 above, and remove both first cleanly as David did)

Please consider renaming the files in mysqlnd to add a nd in the ini file name, as this is f.. pointless loss of hours. At least make sure such bugs don`t reach testing, or even worse stable.

Feed as much as your pet will willingly eat daily until the fleas are gone.
As an alternative Cancer treatment, this liquid has been endorsed by
doctors all over the world. Simple washing will destroy the fleas residing in your animals bedding.

I’m impressed, I have to admit. Rarely do I encounter
a blog that’s both equally educative and interesting, and let me tell you, you’ve
hit the nail on the head. The issue is something
that too few folks are speaking intelligently about.
I’m very happy I came across this during my hunt for something
regarding this.

Comments are closed.