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
總結
以上是生活随笔為你收集整理的php enable all,php中的enable_dl配置如何有用?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java文件放桌面怎么运行不了,不可能使
- 下一篇: mongodb php代码实例,Mong