我正在浏览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