]> granicus.if.org Git - php/commitdiff
Improve warning when trying to load zend ext as PHP module
authorJohannes Schlüter <johannes@php.net>
Wed, 3 Apr 2013 08:59:37 +0000 (10:59 +0200)
committerJohannes Schlüter <johannes@php.net>
Thu, 4 Apr 2013 13:36:46 +0000 (15:36 +0200)
ext/standard/dl.c

index 1960e2ce07e38dc6ca510fc6e889441c674532b2..ceb975e93bd79c120ab0c836de702cd295460c65 100644 (file)
@@ -171,6 +171,11 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC)
        }
 
        if (!get_module) {
+               if (DL_FETCH_SYMBOL(handle, "zend_extension_entry") || DL_FETCH_SYMBOL(handle, "_zend_extension_entry")) {
+                       DL_UNLOAD(handle);
+                       php_error_docref(NULL TSRMLS_CC, error_type, "Invalid library (appears to be a Zend Extension, try loading using zend_extension=%s from php.ini)", filename);
+                       return FAILURE;
+               }
                DL_UNLOAD(handle);
                php_error_docref(NULL TSRMLS_CC, error_type, "Invalid library (maybe not a PHP library) '%s'", filename);
                return FAILURE;