doucan4873 2015-05-09 20:13
浏览 87
已采纳

我可以依赖php扩展存储在/ usr / lib / php5 / 20121212中

I'm creating an ansible role that installs a pear module (pam). I want the role to check if the module is already installed using a creates= clause.

This module installs itself in /usr/lib/php5/20121212/pam.so but it feels a bit shaky to rely on that. What is a better way to find out where the php extension modules are stored?

  • 写回答

1条回答 默认 最新

  • dqsw7529 2015-05-09 21:01
    关注

    No, it's not safe to make assumptions about the install location. The PHP module API number changes with each PHP major version. For instance, 20121212 is the API number used for PHP 5.5. Additionally, the exact path will change based on configuration. For instance, my PHP 5.5 system stores extensions in /usr/lib/php/extensions/no-debug-non-zts-20121212.

    To get the default extension install location for a specific version of PHP, run php-config --extension-dir, using the php-config binary installed for that PHP version.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘