doudun8705 2010-10-16 13:05
浏览 24
已采纳

如何从php代码动态设置php.ini中的指令?

How do we dynamically set directives in php.ini from our code? We were asked this question in our exam. Is this a trick question? I thought we can't set directives directly like that and it requires restarting of Apache server.

Thanks in advance:)

  • 写回答

1条回答 默认 最新

  • drfb52000 2010-10-16 13:08
    关注

    The answer is probably ini_set() that changes a PHP.ini setting for the duration of the current script.

    There is no way to change php.ini's settings themselves from within PHP code (except of course some horrible construction that acquires root privileges, alters php.ini, and restarts the server, but that's hardly what the test was about).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥35 平滑拟合曲线该如何生成
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集