PHP_FUNCTION(confirm_test_compiled)
{
char *arg = NULL;
int arg_len, len;
char *strg;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
return;
}
len = spprintf(&strg, 0, "Congratulations! You have successfully modified ext/%.78s/config.m4. Module %.78s is now compiled into PHP.", "test", arg);
RETURN_STRINGL(strg, len, 0);
}
将confirm_test_compiled改成test_echo
再找到这一段代码:
const zend_function_entry test_functions[] = {
PHP_FE(confirm_test_compiled, NULL) /* For testing, remove later. */
PHP_FE_END /* Must be the last line in test_functions[] */
};
将里面的confirm_test_compiled也改成test_echo
生成解决方案,在项目根目录的Release文件夹里找到自己的php扩展phptest.dll,复制到php的ext文件夹里,在php.ini里配置上:
extension=phptest.dll
重启IIS,新建一个站点,在里面新建一个test.php文件