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.

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

报告相同问题?