--- /dev/null
+PHP_ARG_ENABLE(ancillary, whether to enable my extension,
+[ --enable-my-extension Enable my extension])
+
+if test "$PHP_ANCILLARY" = "yes"; then
+ AC_DEFINE(HAVE_ANCILLARY, 1, [Whether you have my extension])
+ PHP_NEW_EXTENSION(ancillary, php-ancillary.c, $ext_shared)
+fi
\ No newline at end of file
--- /dev/null
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "php.h"
+
+#define PHP_ANCILLARY_VERSION "1.0"
+#define PHP_ANCILLARY_EXTNAME "ancillary"
+
+extern zend_module_entry ancillary_module_entry;
+#define phpext_ancillary_ptr &ancillary_module_entry
+
+// declaration of a custom mop_function()
+PHP_FUNCTION(mop_function);
+
+// list of custom PHP functions provided by this extension
+// set {NULL, NULL, NULL} as the last record to mark the end of list
+static function_entry mop_functions[] = {
+ PHP_FE(mop_function, NULL)
+ {NULL, NULL, NULL}
+};
+
+// the following code creates an entry for the module and registers it with Zend.
+zend_module_entry ancillary_module_entry = {
+#if ZEND_MODULE_API_NO >= 20010901
+ STANDARD_MODULE_HEADER,
+#endif
+ PHP_ANCILLARY_EXTNAME,
+ mop_functions,
+ NULL, // name of the MINIT function or NULL if not applicable
+ NULL, // name of the MSHUTDOWN function or NULL if not applicable
+ NULL, // name of the RINIT function or NULL if not applicable
+ NULL, // name of the RSHUTDOWN function or NULL if not applicable
+ NULL, // name of the MINFO function or NULL if not applicable
+#if ZEND_MODULE_API_NO >= 20010901
+ PHP_ANCILLARY_VERSION,
+#endif
+ STANDARD_MODULE_PROPERTIES
+};
+
+ZEND_GET_MODULE(ancillary)
+
+// implementation of a custom mop_function()
+PHP_FUNCTION(mop_function)
+{
+ RETURN_STRING("This is my function", 1);
+}