У меня есть компиляция mod_xxx.c
, которая включает код Python.
#include "httpd.h"
#include "http_config.h"
#include "http_protocol.h"
#include "ap_config.h"
#include "python2.7/Python.h"
static int r4_handler(request_rec *r)
{
if (strcmp(r->handler, "r4")) {
return DECLINED;
}
r->content_type = "text/html";
if (!r->header_only)
{ Py_Initialize();
Py_Finalize();
ap_rputs("\tPrint test\n", r);}
return OK;
}
XXXXXXXXXXXXXXXXXXXXXXXXX
Но не печатайте «Print test» в моем веб-браузере. Py_Initialize();
Py_Finalize();
функции не работают?