tags:

views:

73

answers:

0

Hi all,

I installed php-5.3.1 and apache 2.2.14, wanted to call Apache API from

a PHP module:

  1. Run ./ext_skel --extname=hello
  2. Modified ext/hello.c and the function PHP_FUNCTION(confirm_hello_compiled) so that it contains:

include "SAPI.h"

include "httpd.h"

include "http_config.h"

include "http_protocol.h"

include "ap_config.h"

request_rec *hello_r;

PHP_FUNCTION(confirm_hello_compiled) { hello_r = (request_rec *)SG(server_context); ap_rprintf(hello_r, "Hello world\n");

    return SUCCESS;

}

  1. Under php root, run ./buildconf and ./configure --with-apxs=/home/www/bin/apxs --enable-hello

It worked so far. But when I ran:

  1. make

I got an error like:

....

ext/hello/.libs/hello.o: In function zif_confirm_hello_compiled': /home/www/php-5.3.1/ext/hello/hello.c:167: undefined reference toap_rprintf'

As far as I know, PHP 5 can only be compiled as DSO and don't have access to compiled objects in Apache 2 directly.

Any help would be greatly appreciated!

Rwe

related questions