PHP. INI

Source: Internet
Author: User
Tags php error reporting
PHP. ini php. INI

Php. ini is used to set the configuration items of PHP. The configuration file (php. ini) is read When PHP is started. For PHP of the server module version, it is read only once when the web server is started. For CGI and CLI versions, each call will read.

The Web servers, CGI, and CLI mentioned here are all PHP runtime environments, that is, SAPI. The SAPI name is obtained using the kernel predefined constant PHP_SAPI or php_sapi_name.

Detailed configuration (http://php.net/manual/zh/ini.list.php)

How to set

Ini_set ()

Note which configurations are available at runtime

Not all INI options can be set through ini_set. There are several modes to distinguish

PHP_INI _ * mode definition

Mode Description
PHP_INI_USER It can be set in user scripts (such as ini_set (), Windows Registry (since PHP 5.3), and. user. ini.
PHP_INI_PERDIR It can be set in php. ini,. htaccess or httpd. conf.
PHP_INI_SYSTEM It can be set in php. ini or httpd. conf.
PHP_INI_ALL Can be set anywhere
Where can I find the php. ini file?
  1. Command line execution in Linux

    php -i | grep php.ini

    You will get Configuration File (php. ini) Path =>/usr/local/php/etcLoaded Configuration File =>/usr/local/php/etc/php. ini

  2. Phpinfo () find Loaded Configuration File

Common Configuration Items
Configuration item Default value Description
Dispay_errors "On" Whether to output information or hide or not. Note that the tone set during running cannot be obtained if a fatal error occurs.
Error_reporting NULL PHP error reporting level
Memory_limit 128 M" PHP script execution memory limit, note that when set to a number, the unit is byte
Max_execution_time "30" The maximum execution time of the script, in seconds. when you run PHP from the command line, the default value is 0.
Post_max_size "8 M" The maximum size of POST data. this setting also affects the maximum size of uploads. Therefore, the value must be greater than upload_max_filesize.
Upload_max_filesize "2 M" Maximum upload limit
Session. gc_maxlifetime "1440" Unit: Seconds. the SESSION expiration time is also related to session. gc_probability and session. gc_pisor. Refer to laruence's article "How to set up a strict 30-minute overdue Session" (http://www.laruence.com/2012/01/10/2469.html)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.