Page 1 of 1

Question about extensions

Posted: Mon May 30, 2005 9:39 pm
by iopossum
I'm writing an application that will make use of the php preprocessor as a child process. Basically, users will load php files and I will need the result of executing the php. Thus, I simply call a command line process of php from my app and store the result in a temporary file.

Now, the problem is that I need some pretty custom behavior, enough to warrant the creation of my own PHP extension. Thus, coming from a C background, I figured it wouldn't be too difficult to do this, and so far it hasn't been too bad. However, I can't seem to do, or understand, one thing.

I don't want to require users of my to have to install my extension (I don't want to expect too much from my users, plus I want a drag and drop installation, so I don't want an installer to do this, and I don't want a restart necessary, etc etc.).

Thus I was planning on using the -z flag, which looked promising. Basically, I wanted to do something like this:

> php -f "some_file.php" -z "my_extension.so"

However, whenever I do this I get this error: my_extension.so doesn't appear to be a valid Zend extension

Now, I know its not a problem in the code since it compiled just fine and I've even tried it using the simple hello_world tutorial available at Zend (hello.so: http://www.zend.com/php/internals/exten ... c=0&view=1 ). Does anyone know what I'm doing incorrectly, and if what I want is even possible?

Thanks in advance,

iopossum