2

I made a couple of testing with the closures in php5.4 and they all worked out until i enabled extension=operator.so. From what i could see was that when this extension is enabled i cannot declare functions like this:

 $myfunc = function($value) {
               return $value;
 }
 echo $myfunc('Hello World');

And the FCGI crashes with an internal server error:

[Wed Aug 07 20:38:17 2013] [warn] [client x.x.x.x] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server

[Wed Aug 07 20:38:17 2013] [error] [client x.x.x.x] Premature end of script headers: index.php

Can anybody help me here? Google is not my friend for a couple of days.

P.S. The above code is the only code left in index.php

helly0d
  • 828
  • 2
  • 10
  • 27

1 Answers1

1

There is quite fresh bug report at https://bugs.php.net/bug.php?id=65403 and it seems to me that it is exact problem you have. It is not fixed yet - but as described in comment in that issue, it can be "solved" by upgrading PHP to 5.5.1 and installing extension from github.

glorpen
  • 76
  • 1
  • 4
  • Besides that bug report which i found a couple of hours after i posted the question, i tried changing to php 5.5.1 but the problem is that i can't find a php55 software collection ( i run on centOS with virtualmin ). And i would love a fix or a tricky solution besides giving up the closure functionality. Still would love to see it on php54 because php55 still has some fixes to be done and it can't yet be in production mode. – helly0d Aug 11 '13 at 23:30
  • I've compiled locally PHP 5.4.18 (downloaded from php.net) without any patches and with operator extension from github (commit 0c4ba514bec77497fe54396b5e5c2b342ac68152), effect - your example is working. I guess your only choice is to compile packages yourself. – glorpen Aug 17 '13 at 00:04
  • Thank you, i will give it a try as soon as i can. – helly0d Aug 19 '13 at 06:42