PHP extension loading from script using dl()

萝らか妹 提交于 2019-12-13 18:16:42

问题


I'm going to buy a (cheap) hosting space with apache/php 5/mysql. Because it's cheap i have no direct control over php.ini and extension loading.

My question is: can i load an extension putting the .dll file into my space and than using dl() php function? Can the host disable this feature thus avoid loading custom extension this way?


回答1:


Yes, it can be disabled through the enable_dl and safe_mode php.ini settings (which would almost certainly be the case, as otherwise you could e.g. load your own code in the web server process).

And that's in addition to the disable_functions setting, which can disable anything.




回答2:


the host can disable any function within php from the php.ini. in fact I would be surprised if the host left this feature on.




回答3:


Since you're talking about a .dll, you are assuming to get a Windows hosting server running PHP, however, is better that you check with the hosting company, because probably dl() will be disabled.

Smaller hosting companies can be more accommodating with adding extensions you may require.



来源:https://stackoverflow.com/questions/7689360/php-extension-loading-from-script-using-dl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!