如何打印用php编译的扩展列表
我试图找出我所获得的 php 二进制文件编译了哪些扩展。有没有办法以编程方式执行此操作?
例如,可以检查扩展/库的版本,
var_dump(curl_version());
但这意味着我必须一一检查,并且我可能无法猜测其中编译的所有库。那么无论如何要让 php 告诉我它编译了哪些扩展?
I'm trying to find out what extensions are compiled with the php binary I've been given. Is there a way to do this programmatically?
For example, it's possible to check what version of an extension/library is there
var_dump(curl_version());
but this means I have to check one by one, and I may not be able to guess all libraries compiled within. So anyway to get php to tell me what extensions it has compiled?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
get_loaded_extensions()
< 怎么样? /a> 功能?您可以将其与
phpversion()
结合使用,这将为您提供以下版本PHP 和(如果作为参数提供)扩展:演示
How about the
get_loaded_extensions()
function?You can use it in combination with
phpversion()
which will give you the version for PHP and (if provided as parameter) the extension:Demo
控制台中的
php -m
将显示模块列表。不确定这是否算作“程序化”。php -m
in the console will show you a list of modules. Not sure if that counts as 'programmatic'.