php一些常规动态设置与获取

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
ini_set('max_execution_time', '600'); //设置最大执行时间
date_default_timezone_get();//使用以下语句来查询当前时区设置
date_default_timezone_set('PRC');//使用以下语句设置当前时间为北京时间
<?php
    //禁用错误报告
    error_reporting(0);
     
    //报告运行时错误
    error_reporting(E_ERROR | E_WARNING | E_PARSE);

    //报告所有错误

    error_reporting(E_ALL);

    ?>

    <?php

    error_reporting(255);   // 列出所有提示

    error_reporting(0);     // 不显示所有提示

    error_reporting(7);     // 建议使用

    ?>

 

 

 设置脚本超时时间:

方法有三:

1、在php.ini里面设置

max_execution_time = 1800;

2、通过PHP的ini_set函数设置

ini_set("max_execution_time", "1800");

3、通过set_time_limit 函数设置

set_time_limit(1800) ;
posted @ 2016-02-03 10:47  侠岚之弋痕夕  阅读(184)  评论(0编辑  收藏  举报
Where is the starting point, we don't have a choice, but the destination where we can pursue!