php的几个配置文件函数

| |
| August 27, 2008 17:49 | root | Via 本站原创
http://www.programfan.com/article/showarticle.asp?id=2816
<?php
/*
Our php.ini contains the following settings:

display_errors = On
register_globals = Off
post_max_size = 8M
*/
echo "display_errors = " . ini_get("display_errors") . "\n"; //显示错误是否打开
echo "register_globals = " . ini_get("register_globals") . "\n";//全局变量是否打开
echo "post_max_size = " . ini_get("post_max_size") . "\n";//最多能提交的文件大小
echo "post_max_size+1 = " . (ini_get("post_max_size")+1) . "\n";
?>

当PHP读取php.ini配置文件中的所有设置信息的同时,它提供了采用ini_set()函数根据per-script原则更改这些设置的功能。此函数接收两个参数:需要调整的配置变量名,以及变量的新值。

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

<?php

ini_set('max_execution_time', 600);
ini_set('display_errors','1');//php默认是不显示错误的,这样可以把错误设置打开。

?>;
本文来自: (www.91linux.com) 详细出处参考:http://www.91linux.com/html/article/program/php/20080626/12829.html
WEB相关 | 评论(0) | 引用(0) | 阅读(70)
发表评论
 网址
 电邮
  密码 游客无需密码
 昵称  *  [注册]
               

 
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我