简体   繁体   English

如何使用 `phpize` 启用 php 扩展?

[英]How to enable php extension using `phpize`?

I tried these steps on different extensions but I don't know why that doesn't work.我在不同的扩展上尝试了这些步骤,但我不知道为什么这不起作用。 Shouldn't I see a change in phpinfo() output after that?在那之后我不应该看到phpinfo() output 的变化吗?

The steps:步骤:

  1. Decompress the php source code and change directory to ext/ext_name解压 php 源代码并将目录更改为ext/ext_name
  2. phpize
  3. configure
  4. make
  5. move manually the "ext_name.so" file from "../.lib" directory to "extension_dir" specified in "php.ini" file.手动将“ext_name.so”文件从“../.lib”目录移动到“php.ini”文件中指定的“extension_dir”。 (or do make install ) (或者做make install
  6. restart web service重启 web 服务

Is there something missing?有什么遗漏吗? I need to enable a certain extension in php and there's no way to recompile the whole php version..我需要在 php 中启用某个扩展,并且无法重新编译整个 php 版本。

If the .so is properly compiled etc, and it's in your extension dir, then you need to add the following line also:如果.so被正确编译等,并且它在您的扩展目录中,那么您还需要添加以下行:

extension=NAME.so

This will force the loading.这将强制加载。 At this point, provided there is actually something to display, it will show in phpinfo() .此时,如果确实有要显示的内容,它将显示在phpinfo()中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM