Home  >  Article  >  Backend Development  >  ini_set更动php.ini配置功能

ini_set更动php.ini配置功能

WBOY
WBOYOriginal
2016-06-13 10:41:17813browse

ini_set更改php.ini配置功能
利用ini_set可以快速的修改php.ini配置设置哦,无需打开php.ini就可以了,特别是虚拟主机时你没有修改php.ini的权限时就会发现这个函数的作用了,下面看几个实例吧。
*/
//ini_set具有更改php.ini设置的功能。此函数接收两个参数:需要调整的配置变量名,以及变量的新值。

//例如,在某脚本出现时增加最大执行时间(maximum execution time):

$old_max_execution_time = ini_set('max_execution_time', 120);
   echo "old timeout is $old_max_execution_time
";

   $max_execution_time = ini_get('max_execution_time');
   echo "new timeout is $max_execution_time
";
  
  
  
  echo 'function sets supported in this install are:
';
  $extensions = get_loaded_extensions();
  foreach ($extensions as $each_ext)
  {
    echo "$each_ext
";
    echo '

    ';
        $ext_funcs = get_extension_funcs($each_ext);
        foreach($ext_funcs as $func)
        {
           echo "
  • $func
  • ";
        }
        echo '
';
  }
?>

更多详细内容请查看:http://www.111cn.net/phper/php-function/34292.htm
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn