ini_set not working

后端 未结 6 515
北恋
北恋 2021-01-07 20:25

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\');         


        
6条回答
  •  暖寄归人
    2021-01-07 21:05

    My answer might be off-topic but I almost always come back to this question via Google when my ini_set calls are not working. Sharing my case might help others to solve a issue with ini_set more quickly.

    So, in my case display_errors is disabled but PHP displays the errors in the browser anyway although I enabled log_errors and set error_log to C:\Windows\Temp\PHP_error.log.

    First impression is always that ini_set is not working BUT it might be a permission issue. If PHP cannot access the log file then it will simply send the errors to the browser.

    Solution: make sure PHP has the permission to access and write the log file.

提交回复
热议问题