php enable all,php中的enable_dl配置如何有用?

我正在浏览php.ini,我发现以下参数enable_dl有一个奇怪的描述:

This directive is really only useful in the Apache module version of

PHP. You can turn dynamic loading of PHP extensions with dl() on and

off per virtual server or per directory.

The main reason for turning dynamic loading off is security. With

dynamic loading, it’s possible to ignore all open_basedir

restrictions. The default is to allow dynamic loading, except when

using safe mode. In safe mode, it’s always impossible to use dl().

我在apache上运行php,我很好奇这个参数究竟对我有用.上面提到的描述对我来说并不是很清楚,所以如果有人能够详细说明我会感激不尽.

解决方法:

PHP模块(扩展)只能在PHP的启动阶段加载.例如,无法使用.user.ini files加载它们.例如,extension directive仅为php.ini.

这是一个提示 – 历史上.user.ini文件不是核心,而是SAPI for Apache mod_php的每个目录.htaccess设置.

为了避免过去的这种限制,引入了dl()函数以在运行时动态加载扩展.但是只有启用,所以enable_dl指令.

但是,当前的PHP SAPI基本上禁用了对dl的支持,只能在CLI和Embed中使用它.

正如你没有说过为什么你对dl()的好奇心,我能给出的最好的答案是它只是为了深奥的原因而有用.很可能它甚至对你想要使用它的SAPI没用(你没有共享SAPI名称,但我想它不是CLI也不是Embed).

标签:php,apache,configuration

来源: https://codeday.me/bug/20190830/1771134.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值