Click to See Complete Forum and Search --> : Configuring PHP to build a shared (not built-in) extension for Apache With PHP?


grue
11-21-2002, 08:02 PM
I created a simple PHP extension using

php-4.23/ext/ext_skel

and, following the instructions, can compile the extension _into_ PHP just fine.

I want to, however, build it as a shared object -- not into PHP.

I configure PHP like so:

./configure --prefix=/my_php_location --with-apache=../apache_1.3.27 --with-mysql=/my_mysql_location --with-gd --with-my_extension=shared

then I 'make clean', 'make', 'make install'.

During the 'make install' execution, I see a line:

installing shared modules into /my_php_location/lib/php/extensions/no-debug-non-zts-20020429

go by but nothing gets copied there. Looking around (including the ext/my_extension/ directory), I see no my_extension.so has been built, but some other files have been built (libmy_extension.la, my_extension.lo, my_extension.o, .libs/...).

What am I doing wrong? Do I need to edit something in ext/my_extension/config.m4? What does the "buildconf" script do (using open source build standards are new to me)? Thanks!

grue
11-21-2002, 08:33 PM
I think I've addressed it by making modifications to configure.m4 and uncommenting:

PHP_EXTENSION(p2pp_mp, $ext_shared)

I don't think this is a PHP topic, but can anyone point to an explanation of what a ".m4" file is and an explanation/tutorial of how ./buildconf ./configure, and all the rest of these little build scripts are supposed to be used?