This article mainly share with you php.ini configuration file information, hope to help everyone.
Set the function information for the php.ini configuration file
There are 4 current summaries of
1 set_time_limit (0); 2 ini_set (' Memory ', ' 2048GB '); 3 date_default_timezone_set (' PRC '); 4 error_reporting (0);
In fact, modify php.ini This configuration file inside the parameters can be ini_set this function to operate, through the function modification is only the current script to set. Modifying a configuration file changes all files in the current environment
1 Set_time_limit (30)
Sets the time, in seconds, that the script is allowed to run. If this setting is exceeded, the script returns a fatal error. The default value is 30 seconds, or the value that is defined in php.ini max_execution_time if this value exists. When this function is called, set_time_limit () Restarts the timeout counter starting from zero. In other words, if the timeout defaults to 30 seconds and the script runs for 25 seconds when Set_time_limit (20) is called, the script can run the total time before timing out
is 45 seconds. There is also a notation of ini_set (' max_execution_time ', ' 30 '); Set the maximum execution time for a script
2 Ini_set (' Memory_limit ', ' 2048GB ');
When running a PHP program, you will typically encounter "Fatal error:allowed memory size of xxxxxx bytes exhausted" error,
This means that the PHP script uses too much memory and exceeds the maximum allowable memory set by the system. Solve this problem,
The first thing you need to see is if your program is allocating too much memory, and if the program doesn't have a problem,
You can use this method to increase the memory limit of PHP (memory_limit) 3 3 date_default_timezone_set (' PRC ')
Set time zone for People's Republic of China
4 error_reporting (0)
Close all error reports
//Report runtime error error_reporting (E_error | e_warning | E_parse)//Report all Errors error_reporting (e_all); equal to: Ini_set ("error_reporting", E_all); Report all errors except E_notice error_reporting (E_all & ~e_notice);