PHP 5.3.6 原始碼目錄:/usr/local/src/php-5.3.6,安裝路徑:/usr/local/php。
cd /usr/local/src/php-5.3.6/ext./ext_skel --extname=laiwenhuilaiwenhui/config.m4,取消註解 PHP_ARG_ENABLE 區塊。PHP_ARG_ENABLE(laiwenhui, whether to enable laiwenhui support, [ --enable-laiwenhui Enable laiwenhui support])php_laiwenhui.h 新增 PHP_FUNCTION(test);laiwenhui.c 於 zend_function_entry 加入 PHP_FE(test, NULL),並於檔尾實作:PHP_FUNCTION(test) { char *arg = "This is my first extention!"; int len; char *strg; len = spprintf(&strg, 0, "%s\n", arg); RETURN_STRINGL(strg, len, 0); }cd /usr/local/src/php-5.3.6/ext/laiwenhui/usr/local/php/bin/phpize./configure --with-php-config=/usr/local/php/bin/php-configmake && make install/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/laiwenhui.soextension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"extension = laiwenhui.sophp -m 確認載入。test.php:<?php echo test(); 輸出 This is my first extention!