How to use Zend extension with PHP built-in server

Viewed 72

I am writing a toy Zend extension.

It works just fine when I run my script:

$ php -z /path/to/my/extension.so script.php
HELLO, TOY EXTENSION!

However, it does not work when I run the built-in development server:

$ php -z /path/to/my/extension.so -S localhost:8080 script.php
[Wed Aug 18 15:25:12 2021] PHP 7.4.21 Development Server (http://localhost:8080) started

As a sanity check, I tried making the extension write to a file instead of stdout, and still nothing happens.

Why isn't the local server using the extension? Naively it seems like this would Just Work. How can I get it to work? This would be very useful for testing and iterative development.

In case it's relevant, the hook where I put my printf is zend_extension.activate, although I have tried others as well (including module_startup).

0 Answers
Related