summaryrefslogtreecommitdiff
path: root/install.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2009-09-01 20:04:36 -0300
committerCraig Andrews <candrews@integralblue.com>2009-09-13 21:53:30 -0400
commitfe9473ac7810d317e001a0fec19cbacaafc0c909 (patch)
tree665ceaec4aa1d19b4ca91c2b59bda7d78f9db939 /install.php
parent4a19c292fb444dca840591a5ccec960d63ab57b8 (diff)
Check that 'dl' function is available and usable before trying to call it with error suppression; if it's disabled or unavailable we end up with mysterious failures during installation or loading of libraries.
Fixed for StatusNet installer as well as some external libraries that should be fixed upstream if they haven't already been: * PEAR * Auth/OpenID * Auth/Yadis
Diffstat (limited to 'install.php')
-rw-r--r--install.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/install.php b/install.php
index c49043e5c..39984aa08 100644
--- a/install.php
+++ b/install.php
@@ -267,12 +267,19 @@ function checkPrereqs()
function checkExtension($name)
{
- if (!extension_loaded($name)) {
- if (!@dl($name.'.so')) {
- return false;
- }
+ if (extension_loaded($name)) {
+ return true;
+ } elseif (function_exists('dl') && ini_get('enable_dl') && !ini_get('safe_mode')) {
+ // dl will throw a fatal error if it's disabled or we're in safe mode.
+ // More fun, it may not even exist under some SAPIs in 5.3.0 or later...
+ $soname = $name . '.' . PHP_SHLIB_SUFFIX;
+ if (PHP_SHLIB_SUFFIX == 'dll') {
+ $soname = "php_" . $soname;
+ }
+ return @dl($soname);
+ } else {
+ return false;
}
- return true;
}
function showLibs()