简体   繁体   中英

No closure support in PHP 5.3.2-1ubuntu4.2

I just realised that a bit of PHP doesn't execute correctly on one server, but it does on another.

They're both running Ubuntu 10.04 with PHP PHP 5.3.2 (PHP 5.3.2-1ubuntu4.2 with Suhosin-Patch (cli) (built: May 13 2010 20:03:45))

I'm testing using:

$f = function() {};

var_dump($f);
die();

On the server that works, the result is:

object(Closure)#1 (0) { }

On the one that doesn't, the result is:

UNKNOWN:0

What am I missing?

[edit]

There seems to be an issue with having 2 closures in the same file:

<?php
$f = function() {};
$f2 = function() {};

var_dump($f);
var_dump($f2);
die();

Outputs:

UNKNOWN:0
object(Closure)#1 (0) {}

After some more Googling combined with ircmaxell's tip at phpinfo, I got a hint at eaccelerator.

The server that ran the code correctly was running eaccelerator 0.9.6.1, the one that didn't work was using 0.9.6.

Compiled the new version from source and it fixed my issue.

Thanks!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM