There are several Apache directives that allow you to change the PHP configuration from within the Apache configuration files. For a listing of which directives are PHP_INI_ALL, PHP_INI_PERDIR, or PHP_INI_SYSTEM.
Sets the value of the specified directive. Can be used only with PHP_INI_ALL and PHP_INI_PERDIR type directives. To clear a previously set value use none as the value.
A handy trick to pick up parse errors in test_file.php if you can't set display_errors in php.ini or use .htaccess:
<?php
error_reporting (E_ALL);
ini_set ('display_errors', true);
include('./test_file.php');
?>
Aonde uma configuração deve ser definida
Estes modos determinam quando e aonde uma diretiva do PHP pode ou não pode ser definida, e cada diretiva no manual faz referencia a um destes modos. Por exemplo, algumas definições podem ser feitas em um script PHP usando ini_set(), aonde outros podem requerer php.ini ou httpd.conf.
Por exemplo, a configuração output_buffering é PHP_INI_PERDIR portanto não pode ser definida usando ini_set(). Entretanto a diretiva display_errors é PHP_INI_ALL portanto pode ser definida em qualquer lugar incluindo com ini_set().
| Modo | Significado |
|---|---|
| PHP_INI_USER | A entrada pode ser definida nos scripts do usuário (como com ini_set()) ou no registro do Windows |
| PHP_INI_PERDIR | A entrada pode ser definida no php.ini, .htaccess ou httpd.conf |
| PHP_INI_SYSTEM | A entrada pode ser definida no php.ini ou httpd.conf |
| PHP_INI_ALL | Entrada pode ser definida em qualquer lugar |
mritunjay dot kumar at ballisticlearning dot com ¶
5 months ago
