添加PHP扩展名以便与其他扩展一起编译


where to add php extension name to compile it with other extensions

我使用ext_skel命令工具创建了示例php扩展。

当我尝试./configure --help从php基础文件夹,我的扩展没有显示在那里。

我应该在哪里添加/启用我的扩展名,以便它将出现在php的./configure --help上。

注意:我可以从php/ext/extname文件夹单独编译它,但我希望它从php与其他扩展库编译。

您需要遵循以下步骤:-

:~/cvs/php4/ext:> ./ext_skel --extname=my_module
Creating directory my_module
Creating basic files: config.m4 .cvsignore my_module.c php_my_module.h CREDITS EXPERIMENTAL tests/001.phpt my_module.php [done].

要使用您的新扩展名,您必须执行以下步骤:

  1. $ vi ext/my_module/config.m4
  2. 。美元/buildconf
  3. $ ./configure——(与|启用)-my_module
  4. 使美元
  5. $ ./php -f ext/my_module/my_module.php
  6. $ vi ext/my_module/my_module.c使美元
重复步骤3-6,直到您对ext/my_module/config满意为止。m4和第6步确认模块已编译为PHP。然后,开始写作根据需要编写代码并重复最后两个步骤。

你需要运行。/buildconf命令,将你的扩展添加到PHP扩展列表中。之后,您将能够通过。/configure -help命令看到您的扩展名。

请参阅http://php.net/manual/en/internals2.ze1.zendapi.php文件以获得更多说明。