backported loading dl extension with -dexetnsion=extension.so from php5.1-200512091130 --- php-5.0.5/sapi/cli/php_cli.c 2005-03-22 17:09:20.000000000 +0200 +++ php5.1-200512091130/sapi/cli/php_cli.c 2005-12-10 01:11:54.000000000 +0200 @@ -397,7 +397,7 @@ } /* }}} */ -static void define_command_line_ini_entry(char *arg) +static void define_command_line_ini_entry(char *arg TSRMLS_DC) { char *name, *value; @@ -409,7 +409,14 @@ } else { value = "1"; } - zend_alter_ini_entry(name, strlen(name)+1, value, strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); + + if (!strcasecmp(name, "extension")) { /* load function module */ + zval extension, zval; + ZVAL_STRING(&extension, value, 0); + php_dl(&extension, MODULE_PERSISTENT, &zval TSRMLS_CC); + } else { + zend_alter_ini_entry(name, strlen(name)+1, value, strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); + } } @@ -656,7 +663,7 @@ switch (c) { case 'd': /* define ini entries on command line */ - define_command_line_ini_entry(php_optarg); + define_command_line_ini_entry(php_optarg TSRMLS_CC); break; case 'h': /* help & quit */