26
PHP Extension Writing
13
Börger, Schlüter
Creating PHP 5 Extensions
þ
Most PHP 4 exts will build in PHP5 w/o Changes
þ
ext_skel can be used to generate a basic skeleton
marcus@zaphod src/php5/ext $ ./ext_skel --extname=util
Creating directory util
Creating basic files: config.m4 .cvsignore util.c php_util.h CREDITS
EXPERIMENTAL tests/001.phpt util.php [done].
To use your new extension, you will have to execute the following steps:
1. $ cd ..
2. $ vi ext/util/config.m4
3. $ ./buildconf --force
4. $ ./configure --[with|enable]-util
5. $ make
6. $ ./sapi/cli/php -f ext/util/util.php
7. $ vi ext/util/util.c
8. $ make
Repeat steps 3-6 until you are satisfied with ext/util/config.m4 and
step 6 confirms that your module is compiled into PHP. Then, start
writing code and repeat the last two steps as often as necessary.
Necessary for non cvs source
(e.g. release packages)