dtcaw02086
2016-02-27 09:24
浏览 581
已采纳

设置php-fpm默认配置文件位置

I've built from source php + php-fpm + nginx few times.

I'm used to keep everything inside /usr/local

Hovewer php-fpm config file php-fpm.conf is always loaded from /etc/

Of course I can change the location with the -y directive when php-fpm is started but I'd prefer to have a different location by default.

Is there any way to do this?

Does the default location depends upon a directive set when running ./config before the actual build?

图片转代码服务由CSDN问答提供 功能建议

我从源代码php + php-fpm + nginx构建了几次。

我习惯将所有内容保存在 / usr / local

Hovewer php-fpm配置文件 php-fpm.conf 总是从 / etc / 加载

当php-fpm为时,我可以使用 -y 指令更改位置 开始了,但我希望默认情况下有一个不同的位置。

有没有办法做到这一点?

默认位置是否依赖于 在实际构建之前运行 ./ config 时的指令集?

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • dongzan7016 2016-02-27 20:49
    已采纳

    Performing a multi-file search on PHP's sources and build files reveals that

    php-fpm.conf location is determined by the compile-time option

    --sysconfdir=/path/to
    

    specified when invoking ./configure

    打赏 评论
  • douxiong2738 2016-02-27 11:28
    • You can compile php with the --with-config-file-path=PATH compile-time option.

      For your reference PHP Compile-Time Options

    • You can use a custom php.ini file using a .htaccess with Apache adding le line

      SetEnv PHPRC /location/todir/containing/phpinifile

    • To specify a custom php.ini with NginX check this link

    • As you pointed out you can use a CLI directive to choose a different php.ini as well

    打赏 评论
  • dtmjqyfz21793 2018-08-20 10:56

    actually the real reason is you used the old TARed php source code,
    you should RM the old TARed php source one and re-Tar xvf php-version.tar.gz,
    lastly, configure it and so on. you can try it if you don't believe it~

    :p

    打赏 评论

相关推荐 更多相似问题