Run the ext_skel script which creates all the required skeleton files.

% cd php4/ext
% ./ext_skel --extname=xmms --proto=xmms.def
Creating directory xmms
Creating basic files: config.m4 Makefile.in .cvsignore xmms.c 
                      php_xmms.h CREDITS EXPERIMENTAL 
                      tests/001.phpt xmms.php [done].
% ls xmms
config.m4    CREDITS       EXPERIMENTAL    xmms.c 
xmms.php     Makefile.in   php_xmms.h      tests/
Standalone or Embedded?
At this point you have a choice on how to proceed. You can either develop your extension under the main PHP framework where you run the top-level buildconf script to include your extension in PHP's main configuration script, or you can develop your extension in a completely separate directory where you run the phpize script to populate your extension directory with all the required files.

Embedded
% cd xmms
% vi config.m4
% cd ../..
% ./buildconf
% ./configure --[with|enable]-xmms
% make
Standalone
% mv xmms /tmp
% cd /tmp/xmms
% vi config.m4
% phpize
% ./configure --[with|enable]-xmms
% make