From: Johannes Schlüter Date: Wed, 3 Apr 2013 08:59:37 +0000 (+0200) Subject: Improve warning when trying to load zend ext as PHP module X-Git-Tag: php-5.5.0beta3~8^2~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9587cf385e9c0220cbd999a13ed73ce5e496515b;p=php Improve warning when trying to load zend ext as PHP module --- diff --git a/ext/standard/dl.c b/ext/standard/dl.c index 1960e2ce07..ceb975e93b 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -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;