Page 1 of 1

problem in callling function of my custom extension

Posted: Fri Nov 01, 2002 8:28 am
by iceberg
Hi,
I've added a function to my custom extension. But from the point I call the function, there is no output. It seems as if there is some exception or error that occurs internally.
In the output I have used 'get_extension_funcs' to list the functions in the extension. This list shows my function.

Following are excerpts from from my code :
In header file :
PHP_FUNCTION(Init);

In C file :
function_entry php_mcelite_functions[] = {
PHP_FE(Init, NULL)
PHP_FE(confirm_php_mcelite_compiled, NULL) /* For testing, remove later. */
{NULL, NULL, NULL} /* Must be the last line in php_mcelite_functions[] */
};

PHP_FUNCTION(Init)
{
RETURN_TRUE ;
}

I've even turned on the log, but the log does not have any info.

Can anyone give some help/hint ?
Thanks in advance.
iceberg.

Are you running PHP from command line or via a browser?

Posted: Thu Dec 05, 2002 2:28 pm
by lambart
Since you haven't included an example of the .php file you are using to test your code, I have no idea what "output" you are expecting.

But if you run PHP from the command line, you might get more feedback as to what is going wrong. If you configure PHP without the --with-apxs option, it will compile a local executable which you can then use something like this:
$ ./php ext/my_extension/my_extension.php

Your post is very vague, so I don't know if this will help, but it's worth a shot.