dnl PHP_ARG_WITH(my_ext, for my_ext support, dnl Make sure that the comment is aligned:
dnl [ --with-my_ext Include my_ext support]) 修改成
PHP_ARG_WITH(my_ext, for my_ext support, Make sure that the comment is aligned:
[ --with-my_ext Include my_ext support]) 或者将
dnl PHP_ARG_ENABLE(my_ext, whether to enable my_ext support, dnl Make sure that the comment is aligned:
dnl [ --enable-my_ext Enable my_ext support]) 修改成
PHP_ARG_ENABLE(my_ext, whether to enable my_ext support,
Make sure that the comment is aligned: [ --enable-my_ext Enable my_ext support])
$ vi ext/my_ext/php_my_ext.h
将 PHP_FUNCTION(confirm_my_ext_compiled); /* For testing, remove later. */ 更改为 PHP_FUNCTION(say_hello);
$ vi ext/my_ext/my_ext.c
将 zend_function_entry php5cpp_functions[] = { PHP_FE(confirm_my_ext_compiled, NULL) /* For testing, remove later. */ {NULL, NULL, NULL} /* Must be the last line in php5cpp_functions[] */ }; 更改为 zend_function_entry php5cpp_functions[] = { PHP_FE(say_hello, NULL) {NULL, NULL, NULL} /* Must be the last line in php5cpp_functions[] */ };