PHP - php.ini and php configuration

> Procedural Languages > Php

1 - About

Php configuration.

Advertising

3 - Management

3.1 - Dynamic

3.1.1 - Set

default_socket_timeout is a ini timeout property. To change it dynamically, you use ini_set

ini_set("default_socket_timeout", 1);

Example with the php utility and the r option.

time php -n -r 'ini_set("default_socket_timeout", 1); fopen("https://127.0.0.1/sleepforever.php", "r");'

3.1.2 - Get

Gets the value of a configuration option

ini_get()

3.2 - Static: Php.ini

3.2.1 - Location

  • at the command line with php
php --ini
Configuration File (php.ini) Path: C:\Windows
Loaded Configuration File:         D:\xampp\php\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)
  • the web server: To get the location of the configuration file php.ini, search the section “Loaded Configuration File” from the ouptut of the following php file. Example: phpinfo.php
phpinfo();
Advertising