php enable all,php中的enable_dl配置如何有用?
我正在瀏覽php.ini,我發(fā)現(xiàn)以下參數(shù)enable_dl有一個(gè)奇怪的描述:
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上運(yùn)行php,我很好奇這個(gè)參數(shù)究竟對(duì)我有用.上面提到的描述對(duì)我來說并不是很清楚,所以如果有人能夠詳細(xì)說明我會(huì)感激不盡.
解決方法:
PHP模塊(擴(kuò)展)只能在PHP的啟動(dòng)階段加載.例如,無法使用.user.ini files加載它們.例如,extension directive僅為php.ini.
這是一個(gè)提示 – 歷史上.user.ini文件不是核心,而是SAPI for Apache mod_php的每個(gè)目錄.htaccess設(shè)置.
為了避免過去的這種限制,引入了dl()函數(shù)以在運(yùn)行時(shí)動(dòng)態(tài)加載擴(kuò)展.但是只有啟用,所以enable_dl指令.
但是,當(dāng)前的PHP SAPI基本上禁用了對(duì)dl的支持,只能在CLI和Embed中使用它.
正如你沒有說過為什么你對(duì)dl()的好奇心,我能給出的最好的答案是它只是為了深?yuàn)W的原因而有用.很可能它甚至對(duì)你想要使用它的SAPI沒用(你沒有共享SAPI名稱,但我想它不是CLI也不是Embed).
標(biāo)簽:php,apache,configuration
來源: https://codeday.me/bug/20190830/1771134.html
總結(jié)
以上是生活随笔為你收集整理的php enable all,php中的enable_dl配置如何有用?的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java文件放桌面怎么运行不了,不可能使
- 下一篇: matlab命令fvtool,FVToo