如何检查全局PHP.INI或PHP脚本中是否启用了ini_set()? [英] How do I check if ini_set() is enabled either in the global PHP.INI or in my PHP script?

查看:299
本文介绍了如何检查全局PHP.INI或PHP脚本中是否启用了ini_set()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个安装失败的应用程序.供应商说我可能禁用了ini_set().我该如何检查?

I have an app that is failing on the install. The vendor says I probably have ini_set() disabled. How can I check this?

推荐答案

我对此进行了一些研究,结果有时ini_set不会返回FALSE,而是一个空字符串. gabriel1836指出的网址中提到了这一点.检查它是否有效的最佳方法是,首先检查php.ini中的disable_functions标志,以查看它是否被禁用,然后(如果未禁用),更改它的值,然后立即回显phpinfo().如果在本地列下更改了该值,则您知道ini_set有效.

I did some research on this, and it turns out that sometimes ini_set will not return FALSE, but an empty string. This is mentioned in the URL pointed out by gabriel1836. The best way to check if it works is to first check the disable_functions flag in php.ini to see if it is disabled, and then (if it is not disabled), change a value with it, and echo phpinfo() immediately after. If the value is changed under the local column, then you know ini_set works.

这篇关于如何检查全局PHP.INI或PHP脚本中是否启用了ini_set()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆