From: bruno dot premont at restena dot lu
Operating system: Linux
PHP version: 5.4.17
Package: FPM related
Bug Type: Bug
Bug description:PHP-5.4.x and PHP-5.5.x extensions single-shot when loaded
per-pool
Description:
------------
Loading extensions on a per-pool basis make the extension usable only a
single time per worker process.
Loading the extension globally for PHP via php.ini works fine.
Working setup:
php.ini:
extension=radius.so
Failing setup:
php-fpm.conf
[pool]
php_admin_value[extension] = radius.so
On failing setup following test-script fails with radius_auth_open:
undefined function for second request. Easiest testing is pm=ondemand, long
enough pm.process_idle_timeout and two subsequent requests. First request
works, second one fails. The module is still reported as loaded and its
functions are still returned by get_extension_funcs() even though they are
undefined.
Test script:
---------------
<?php
date_default_timezone_set('Europe/Luxembourg');
header('Content-Type: text/plain; charset=UTF-8');
printf("Checking for 'radius' extension: %s\n", extension_loaded('radius')
? 'loaded' : 'missing');
$fa = get_extension_funcs('radius');
printf("Checking for 'radius' extension functions:%d\n", $fa === false ? -1
: count($fa));
if ($fa !== false)
foreach ($fa as $faf)
printf("\t%s(): %s\n", $faf, function_exists($faf) ?
'exists' : 'missing');
flush();
printf("Calling radius_auth_open():\n");flush();
$rh = function_exists('radius_auth_open') ? radius_auth_open() : false;
printf("\t%s\n", $rh === false ? 'false' : 'resource');
if ($rh) {
// use $rh
...
printf("Calling radius_close()\n");flush();
$r = radius_close($rh);
printf("\t%s\n", $r === true ? 'success' : 'failed');
}
?>
Expected result:
----------------
The radius functions should be usable for each request and not only the
ones that happens to be the first request processed by the respective
worker.
Actual result:
--------------
First request works, second and subsequent requests to same worker process
fail with undefined function on any call to extension functions.
extension_loaded() and get_extension_funcs() still return same information
for subsequent requests as they do for the first request.
--
Edit bug report at https://bugs.php.net/bug.php?id=65277&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=65277&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=65277&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=65277&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=65277&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=65277&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65277&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=65277&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=65277&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=65277&r=support
Expected behavior: https://bugs.php.net/fix.php?id=65277&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=65277&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=65277&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=65277&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65277&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=65277&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=65277&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=65277&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65277&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65277&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=65277&r=mysqlcfg