dscdttg4389 2012-09-27 09:40
浏览 121
已采纳

ini_set无法正常工作

Here is the matter:

ini_set('display_errors', '1');
ini_set('safe_mode', '0');
ini_set('allow_url_fopen', '1');
ini_set('allow_url_include', '1');
print_r(ini_get_all());

And I get:

Array(
    [allow_url_fopen] => Array
        (
            [global_value] => 1
            [local_value] => 1
            [access] => 4
        )

    [allow_url_include] => Array
        (
            [global_value] => 
            [local_value] => 
            [access] => 4
        )

Why I cannot set that variable within the php ini_set function? The directive is specified as PHP_INI_ALL then it can be defined within the ini_set() function! http://php.net/manual/en/ini.list.php

  • 写回答

6条回答 默认 最新

  • doudi1449 2012-09-27 09:47
    关注

    display_errors

    may be set at runtime (with ini_set()), but it won't have any affect if the script has fatal errors. This is because the desired runtime action does not get executed.

    Use ini_set('display_errors','Off');

    safe_mode

    This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0. This directive belongs to PHP_INI_SYSTEM and Cannot be set via ini_set()

    allow_url_include

    Use ini_set('allow_url_include', 'On');

    allow_url_fopen

    This directive belongs to PHP_INI_SYSTEM and Cannot be set via ini_set()

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改