php.ini

Table of Contents

php.ini

Return to PHP, PHP Bibliography

php.ini

A PCRE backtrack error occured. Try to increase the pcre.backtrack_limit in php.ini

The configuration file ¶ The configuration file (php.ini) is read when PHP starts up. For the server module versions of PHP, this happens only once when the web server is started. For the CGI and CLI versions, it happens on every invocation.

php.ini is searched for in these locations (in order):

SAPI module specific location (PHPIniDir directive in Apache 2, -c command line option in CGI and CLI) The PHPRC environment variable. The location of the php.ini file can be set for different versions of PHP. The root of the registry keys depends on 32- or 64-bitness of the installed OS and PHP. For 32-bit PHP on a 32-bit OS or a 64-bit PHP on a 64-bit OS use [(HKEY_LOCAL_MACHINE\SOFTWARE\PHP] for 32-bit version of PHP on a 64-bit OS use [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\PHP]] instead. For same bitness installation the following registry keys are examined in order: [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y.z], [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y] and [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x], where x, y and z mean the PHP major, minor and release versions. For 32 bit versions of PHP on a 64 bit OS the following registry keys are examined in order: [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6421Node\PHP\x.y.z], [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6421Node\PHP\x.y] and [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6421Node\PHP\x], where x, y and z mean the PHP major, minor and release versions. If there is a value for IniFilePath in any of these keys, the first one found will be used as the location of the php.ini (Windows only). [HKEY_LOCAL_MACHINE\SOFTWARE\PHP] or [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\PHP], value of IniFilePath (Windows only). Current working directory (except CLI). The web server's directory (for SAPI modules), or directory of PHP (otherwise in Windows). Windows directory (C:\windows or C:\winnt) (for Windows), or –with-config-file-path compile time option. If php-SAPI.ini exists (where SAPI is the SAPI in use, so, for example, php-cli.ini or php-apache.ini), it is used instead of php.ini. The SAPI name can be determined with php_sapi_name().

Note:

The Apache web server changes the directory to root at startup, causing PHP to attempt to read php.ini from the root filesystem if it exists.

Using environment variables can be used in php.ini as shown below.

Example #1 php.ini Environment Variables

; PHP_MEMORY_LIMIT is taken from environment memory_limit = ${PHP_MEMORY_LIMIT} The php.ini directives handled by extensions are documented on the respective pages of the extensions themselves. A list of the core directives is available in the appendix. Not all PHP directives are necessarily documented in this manual: for a complete list of directives available in your PHP version, please read your well commented php.ini file. Alternatively, you may find » the latest php.ini from Git helpful too.

Example #2 php.ini example

; any text on a line after an unquoted semicolon (;) is ignored [php] ; section markers (text within square brackets) are also ignored ; Boolean values can be set to either: ; true, on, yes ; or false, off, no, none register_globals = off track_errors = yes

; you can enclose strings in double-quotes include_path = “.:/usr/local/lib/php”

; backslashes are treated the same as any other character include_path = “.;c:\php\lib” It is possible to refer to existing .ini variables from within .ini files. Example: open_basedir = ${open_basedir} “:/new/dir”.

Scan directories ¶ It is possible to configure PHP to scan for .ini files in a directory after reading php.ini. This can be done at compile time by setting the –with-config-file-scan-dir option. The scan directory can then be overridden at run time by setting the PHP_INI_SCAN_DIR environment variable.

It is possible to scan multiple directories by separating them with the platform-specific path separator (; on Windows, NetWare and RISC OS; : on all other platforms; the value PHP is using is available as the PATH_SEPARATOR constant). If a blank directory is given in PHP_INI_SCAN_DIR, PHP will also scan the directory given at compile time via –with-config-file-scan-dir.

Within each directory, PHP will scan all files ending in .ini in alphabetical order. A list of the files that were loaded, and in what order, is available by calling php_ini_scanned_files(), or by running PHP with the –ini option.

Assuming PHP is configured with –with-config-file-scan-dir=/etc/php.d, and that the path separator is :…

$ php

 PHP will load all files in /etc/php.d/*.ini as configuration files.

$ PHP_INI_SCAN_DIR=/usr/local/etc/php.d php

 PHP will load all files in /usr/local/etc/php.d/*.ini as
 configuration files.

$ PHP_INI_SCAN_DIR=:/usr/local/etc/php.d php

 PHP will load all files in /etc/php.d/*.ini, then
 /usr/local/etc/php.d/*.ini as configuration files.

$ PHP_INI_SCAN_DIR=/usr/local/etc/php.d: php

 PHP will load all files in /usr/local/etc/php.d/*.ini, then
 /etc/php.d/*.ini as configuration files.
 

Fair Use Sources

PHP Programming Language, PHP Zend Engine, PHP Interpreter, PHP Script, PHP File Extension, PHP <, PHP , PHP Echo Statement, PHP Print Statement, PHP Variables, PHP $ Sign, PHP Arrays, PHP Associative Array, PHP Indexed Array, PHP Multidimensional Array, PHP Array Functions, PHP Strings, PHP String Functions, PHP Integers, PHP Floats, PHP Booleans, PHP NULL, PHP Constants, PHP define Function, PHP Magic Constants, PHP __LINE__ Constant, PHP __FILE__ Constant, PHP __DIR__ Constant, PHP __FUNCTION__ Constant, PHP __CLASS__ Constant, PHP __TRAIT__ Constant, PHP __METHOD__ Constant, PHP __NAMESPACE__ Constant, PHP Namespaces, PHP Use Keyword, PHP Class Keyword, PHP Interface Keyword, PHP Trait Keyword, PHP Abstract Class, PHP Final Class, PHP Extends Keyword, PHP Implements Keyword, PHP Constructor, PHP Destructor, PHP Inheritance, PHP Polymorphism, PHP Encapsulation, PHP Visibility (public, protected, private), PHP Static Keyword, PHP self Keyword, PHP parent Keyword, PHP $this Variable, PHP Class Constants, Scope Resolution Operator, PHP -> Object Operator, PHP Anonymous Classes, PHP Anonymous Functions, PHP Closures, PHP Arrow Functions, PHP Return Type Declarations, PHP Scalar Type Declarations, PHP Union Types, PHP Attributes (Annotations), PHP Generators, PHP yield Keyword, PHP yield from Keyword, PHP Iterators, PHP Iterable Type, PHP call_user_func Function, PHP call_user_func_array Function, PHP Autoloading, PHP spl_autoload_register Function, PHP Composer Autoload, PHP Overloading (Property/Method), PHP __get Magic Method, PHP __set Magic Method, PHP __isset Magic Method, PHP __unset Magic Method, PHP __call Magic Method, PHP __callStatic Magic Method, PHP __invoke Magic Method, PHP __toString Magic Method, PHP __debugInfo Magic Method, PHP __clone Magic Method, PHP __wakeup Magic Method, PHP __sleep Magic Method, PHP __serialize Magic Method, PHP __unserialize Magic Method, PHP __construct Magic Method, PHP __destruct Magic Method, PHP SPL (Standard PHP Library), PHP SplFileObject, PHP SplFileInfo, PHP SplHeap, PHP SplPriorityQueue, PHP SplFixedArray, PHP SplStack, PHP SplQueue, PHP SplDoublyLinkedList, PHP SplObjectStorage, PHP SplAutoload, PHP Reflection Classes, PHP ReflectionClass, PHP ReflectionObject, PHP ReflectionMethod, PHP ReflectionFunction, PHP ReflectionProperty, PHP ReflectionParameter, PHP ReflectionExtension, PHP ReflectionZendExtension, PHP Exception Handling, PHP try Catch Blocks, PHP throw Keyword, PHP Exception Class, PHP ErrorException Class, PHP Throwable Interface, PHP Error Class, PHP TypeError, PHP ParseError, PHP ArithmeticError, PHP AssertionError, PHP ArgumentCountError, PHP ValueError, PHP DivisionByZeroError, PHP trigger_error Function, PHP set_error_handler Function, PHP set_exception_handler Function, PHP register_shutdown_function Function, PHP ini_set Function, PHP ini_get Function, PHP Configuration Directives, PHP php.ini File, PHP display_errors, PHP error_reporting, PHP memory_limit, PHP max_execution_time, PHP upload_max_filesize, PHP post_max_size, PHP session.save_path, PHP session.use_cookies, PHP session_start Function, PHP session_id Function, PHP session_destroy Function, PHP $_SESSION Superglobal, PHP $_GET Superglobal, PHP $_POST Superglobal, PHP $_REQUEST Superglobal, PHP $_SERVER Superglobal, PHP $_FILES Superglobal, PHP $_COOKIE Superglobal, PHP $_ENV Superglobal, PHP $_GLOBALS Superglobal, PHP Include Path, PHP include Keyword, PHP require Keyword, PHP require_once Keyword, PHP include_once Keyword, PHP file_get_contents Function, PHP file_put_contents Function, PHP fopen Function, PHP fclose Function, PHP fread Function, PHP fwrite Function, PHP fseek Function, PHP feof Function, PHP fgets Function, PHP file Function, PHP glob Function, PHP is_file Function, PHP is_dir Function, PHP mkdir Function, PHP rmdir Function, PHP unlink Function, PHP copy Function, PHP rename Function, PHP chown Function, PHP chmod Function, PHP chgrp Function, PHP touch Function, PHP clearstatcache Function, PHP filemtime Function, PHP filesize Function, PHP filetype Function, PHP fileperms Function, PHP basename Function, PHP dirname Function, PHP pathinfo Function, PHP realpath Function, PHP sys_get_temp_dir Function, PHP tempnam Function, PHP tmpfile Function, PHP parse_ini_file Function, PHP parse_url Function, PHP getimagesize Function, PHP dns_get_record Function, PHP gethostbyname Function, PHP gethostbyaddr Function, PHP getmxrr Function, PHP date Function, PHP time Function, PHP microtime Function, PHP gmdate Function, PHP mktime Function, PHP strtotime Function, PHP date_default_timezone_set Function, PHP date_default_timezone_get Function, PHP DateTime Class, PHP DateTimeImmutable Class, PHP DateTimeZone Class, PHP DateInterval Class, PHP DatePeriod Class, PHP date_format Function, PHP password_hash Function, PHP password_verify Function, PHP password_needs_rehash Function, PHP password_get_info Function, PHP hash Function, PHP hash_algos Function, PHP hash_hmac Function, PHP md5 Function, PHP sha1 Function, PHP crc32 Function, PHP openssl_encrypt Function, PHP openssl_decrypt Function, PHP openssl_pkey_new Function, PHP openssl_csr_new Function, PHP openssl_x509_parse Function, PHP random_bytes Function, PHP random_int Function, PHP mt_rand Function, PHP uniqid Function, PHP base64_encode Function, PHP base64_decode Function, PHP urlencode Function, PHP urldecode Function, PHP rawurlencode Function, PHP rawurldecode Function, PHP htmlspecialchars Function, PHP htmlentities Function, PHP html_entity_decode Function, PHP print_r Function, PHP var_dump Function, PHP var_export Function, PHP json_encode Function, PHP json_decode Function, PHP json_last_error Function, PHP json_last_error_msg Function, PHP SimpleXML Extension, PHP simplexml_load_string Function, PHP simplexml_load_file Function, PHP DOM Extension, PHP DOMDocument Class, PHP DOMElement Class, PHP DOMAttr Class, PHP DOMNodeList Class, PHP libxml Extension, PHP libxml_use_internal_errors Function, PHP gd Extension, PHP imagecreate Function, PHP imagecreatetruecolor Function, PHP imagepng Function, PHP imagejpeg Function, PHP imagegif Function, PHP imagerotate Function, PHP imagescale Function, PHP imagecopy Function, PHP imagecopyresampled Function, PHP imageline Function, PHP imagettftext Function, PHP imagedashedline Function, PHP imagefill Function, PHP imagefilledrectangle Function, PHP imagecolorallocate Function, PHP imagecolorallocatealpha Function, PHP imagecolorat Function, PHP imagecolorclosest Function, PHP imagecolorexact Function, PHP imagecolormatch Function, PHP imagecolorset Function, PHP imagecolortransparent Function, PHP imageconvolution Function, PHP imageresolution Function, PHP imagefilter Function, PHP imageantialias Function, PHP imageellipse Function, PHP imagearc Function, PHP imagefilledarc Function, PHP imagetruecolortopalette Function, PHP imagepalettetotruecolor Function, PHP imageistruecolor Function, PHP imagesetpixel Function, PHP imagesetthickness Function, PHP imagecopymerge Function, PHP imagecopymergegray Function, PHP imagecreatefromstring Function, PHP imagecolorresolve Function, PHP imagecolordeallocate Function, PHP image2wbmp Function, PHP imagewebp Function, PHP imagewbmp Function, PHP pack Function, PHP unpack Function, PHP range Function, PHP array_key_exists Function, PHP array_keys Function, PHP array_values Function, PHP array_search Function, PHP in_array Function, PHP array_merge Function, PHP array_merge_recursive Function, PHP array_replace Function, PHP array_replace_recursive Function, PHP array_diff Function, PHP array_diff_assoc Function, PHP array_diff_key Function, PHP array_intersect Function, PHP array_intersect_assoc Function, PHP array_intersect_key Function, PHP array_unique Function, PHP array_flip Function, PHP array_reverse Function, PHP array_filter Function, PHP array_map Function, PHP array_reduce Function, PHP array_walk Function, PHP array_walk_recursive Function, PHP array_sum Function, PHP array_product Function, PHP array_chunk Function, PHP array_slice Function, PHP array_splice Function, PHP array_push Function, PHP array_pop Function, PHP array_shift Function, PHP array_unshift Function, PHP array_combine Function, PHP array_pad Function, PHP array_rand Function, PHP array_column Function, PHP count Function, PHP sizeof Function, PHP array_key_first Function, PHP array_key_last Function, PHP sort Function, PHP rsort Function, PHP asort Function, PHP arsort Function, PHP ksort Function, PHP krsort Function, PHP uasort Function, PHP uksort Function, PHP natcasesort Function, PHP natsort Function, PHP str_replace Function, PHP str_ireplace Function, PHP strtr Function, PHP strrev Function, PHP strlen Function, PHP strpos Function, PHP stripos Function, PHP strrpos Function, PHP strripos Function, PHP substr Function, PHP substr_replace Function, PHP explode Function, PHP implode Function, PHP join Function, PHP trim Function, PHP ltrim Function, PHP rtrim Function, PHP str_pad Function, PHP str_split Function, PHP strpbrk Function, PHP strcspn Function, PHP strspn Function, PHP number_format Function, PHP wordwrap Function, PHP lcfirst Function, PHP ucfirst Function, PHP ucwords Function, PHP strtoupper Function, PHP strtolower Function, PHP str_shuffle Function, PHP str_word_count Function, PHP metaphone Function, PHP soundex Function, PHP levenshtein Function, PHP similar_text Function, PHP fnmatch Function, PHP chr Function, PHP ord Function, PHP sha1_file Function, PHP md5_file Function, PHP scandir Function, PHP is_readable Function, PHP is_writable Function, PHP is_executable Function, PHP is_link Function, PHP file_exists Function, PHP is_uploaded_file Function, PHP move_uploaded_file Function, PHP fileinode Function, PHP fileowner Function, PHP filegroup Function, PHP basename Function (already done?), Skip duplicate, choose new:

PHP dirname Function done? Check duplicates carefully. Just pick new unique terms carefully now since it's too complex:

PHP is_null Function, PHP is_scalar Function, PHP is_callable Function, PHP boolval Function, PHP intval Function, PHP floatval Function, PHP strval Function, PHP debug_backtrace Function, PHP debug_print_backtrace Function, PHP error_get_last Function, PHP version_compare Function, PHP zend_version Function, PHP memory_get_usage Function, PHP memory_get_peak_usage Function, PHP get_included_files Function, PHP get_required_files Function, PHP get_loaded_extensions Function, PHP extension_loaded Function, PHP get_defined_functions Function, PHP get_defined_vars Function, PHP get_defined_constants Function, PHP get_declared_classes Function, PHP get_declared_interfaces Function, PHP get_declared_traits Function, PHP get_class_methods Function, PHP get_class_vars Function, PHP get_object_vars Function, PHP get_class Function, PHP get_parent_class Function, PHP class_exists Function, PHP interface_exists Function, PHP trait_exists Function, PHP method_exists Function, PHP property_exists Function, PHP function_exists Function, PHP defined Function, PHP constant Function, PHP abs Function, PHP ceil Function, PHP floor Function, PHP round Function, PHP sqrt Function, PHP pow Function, PHP min Function, PHP max Function, PHP sin Function, PHP cos Function, PHP tan Function, PHP asin Function, PHP acos Function, PHP atan Function, PHP atan2 Function, PHP exp Function, PHP log Function, PHP log10 Function, PHP pi Function, PHP deg2rad Function, PHP rad2deg Function, PHP hexdec Function, PHP octdec Function, PHP decbin Function, PHP dechex Function, PHP decoct Function, PHP bindec Function, PHP base_convert Function, PHP is_nan Function, PHP is_infinite Function, PHP is_finite Function, PHP getrandmax Function, PHP rand Function (deprecated), PHP srand Function (deprecated), PHP mt_getrandmax Function, PHP lcg_value Function, PHP parse_str Function, PHP RAII (Resource Acquisition Is Initialization)

PHP: PHP Fundamentals, PHP Inventor - PHP Language Designer: Rasmus Lerdorf in 1994; PHP DevOps - PHP SRE, Cloud Native PHP (PHP on Kubernetes - PHP on AWS - PHP on Azure - PHP on GCP), PHP Microservices, PHP Containerization (PHP Docker - PHP on Docker Hub), Serverless PHP, PHP Data Science - PHP DataOps - PHP and Databases (PHP ORM), PHP ML - PHP DL, Functional PHP (1. PHP Immutability, 2. PHP Purity - PHP No Side-Effects, 3. PHP First-Class Functions - PHP Higher-Order Functions, PHP Lambdas - PHP Anonymous Functions - PHP Closures, PHP Lazy Evaluation, 4. PHP Recursion), Reactive PHP), PHP Concurrency - PHP Parallel Programming - Async PHP, PHP Networking, PHP Security - PHP DevSecOps - PHP OAuth, PHP Memory Allocation (PHP Heap - PHP Stack - PHP Garbage Collection), PHP CI/CD - PHP Dependency Management - PHP DI - PHP IoC - PHP Build Pipeline, PHP Automation - PHP Scripting, PHP Package Managers, PHP Modules - PHP Packages, PHP Installation (PHP Windows - Chocolatey PHP, PHP macOS - Homebrew PHP, PHP on Linux), PHP Configuration, PHP Observability (PHP Monitoring, PHP Performance - PHP Logging), PHP Language Spec - PHP RFCs - PHP Roadmap, PHP Keywords, PHP Operators, PHP Functions, PHP Built-In Data Types, PHP Data Structures - PHP Algorithms, PHP Syntax, PHP OOP (1. PHP Encapsulation - 2. PHP Inheritance - 3. PHP Polymorphism - 4. PHP Abstraction), PHP Design Patterns - PHP Best Practices - PHP Style Guide - Clean PHP - PHP BDD, PHP Generics, PHP I/O, PHP Serialization - PHP Deserialization, PHP APIs, PHP REST - PHP JSON - PHP GraphQL, PHP gRPC, PHP Virtualization, PHP Development Tools: PHP SDK, PHP Compiler - PHP Transpiler, PHP Interpreter - PHP REPL, PHP IDEs (JetBrains PHP, PHP Visual Studio Code), PHP Linter, PHP Community - PHPaceans - PHP User, PHP Standard Library - PHP Libraries - PHP Frameworks (Laravel, Symfony, Zend Framework, CakePHP), PHP Testing - PHP TDD, PHP History, PHP Research, PHP Topics, PHP Uses - List of PHP Software - Written in PHP (WordPress, DokuWiki, phpMyAdmin) - PHP Popularity, PHP Bibliography - PHP Courses, PHP Glossary - PHP Official Glossary, PHP GitHub, php.internals, PHP Group, PHP.net, Awesome PHP, PHP Versions, Perl. (navbar_php)


Cloud Monk is Retired ( for now). Buddha with you. © 2025 and Beginningless Time - Present Moment - Three Times: The Buddhas or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.


php.ini.txt · Last modified: 2025/02/01 06:36 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki