]> granicus.if.org Git - php/commitdiff
- Disabled dl() when PHP is being used as a module inside a multithreaded web
authorZeev Suraski <zeev@php.net>
Mon, 26 Jun 2000 18:27:12 +0000 (18:27 +0000)
committerZeev Suraski <zeev@php.net>
Mon, 26 Jun 2000 18:27:12 +0000 (18:27 +0000)
  server - it didn't work before, and caused weird results (Zeev)

NEWS
ext/standard/dl.c

diff --git a/NEWS b/NEWS
index 2effc415e8715ea869da680b638e4d7ee3265ae9..06f07111efcc02cd1be4308d2371bb44a7037f40 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,9 @@
 PHP 4.0                                                                    NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
-25 Jun 2000, Version 4.0.1
+28 Jun 2000, Version 4.0.1
+- Disabled dl() when PHP is being used as a module inside a multithreaded web
+  server - it didn't work before, and caused weird results (Zeev)
 - Added the ImageColorClosestHWB(), ImageCopyMerge() and ImagePaletteCopy() 
   functions. (Sterling)
 - Added ImageCreateFromWBMP() function. (Jouni)
index bf3c1af0079ba3cd0b2c6f5c20c42e0f02a36c06..1dbeb487e4ac4d6f9d5093913ce4af2768f265bd 100644 (file)
@@ -22,6 +22,7 @@
 #include "dl.h"
 #include "php_globals.h"
 #include "ext/standard/info.h"
+#include "SAPI.h"
 
 #ifdef HAVE_LIBDL
 #include <stdlib.h>
@@ -51,6 +52,12 @@ PHP_FUNCTION(dl)
        pval **file;
        PLS_FETCH();
 
+#ifdef ZTS
+       if (strcmp(sapi_module.name, "cgi")!=0) {
+               php_error(E_ERROR, "dl() is not supported in multithreaded Web servers - use extension statements in your php.ini");
+       }
+#endif
+
        /* obtain arguments */
        if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) {
                WRONG_PARAM_COUNT;