views:

56

answers:

3

I have code that is straight forward, but intensive. I would like to compile it into a PHP extension. What is the simplest / best practice for going about that?

I have a Java background, so writing the C / C++ code shouldn't be an issue. I would, however, like to avoid any pitfalls along the way.

A simple tutorial or walk through is something I haven't been able to find. Plenty of examples, but nothing aimed at someone new to doing this.

It looks like a more arduous road then I though, especially with all the lovely C quirks.

A: 

I would recommend reading How To Write PHP Extensions by Justin Silverton.

jojaba
This is a link to a simplistic blog post comparing different extensions, not an answer.
Josh K
A: 

The PHP Manual and this Zend article seem to cover quite a bit of ground in regards to writing PHP extensions.

Russell Dias
A: 

The the tag info for php-extension and in particular, this answer, also linked from there.

Artefacto