How to change configuration settingsRunning PHP as an Apache moduleWhen using PHP as an Apache module, you can also change the configuration settings using directives in Apache configuration files (e.g. httpd.conf) and .htaccess files. You will need "AllowOverride Options" or "AllowOverride All" privileges to do so.
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
Example #1 Apache configuration example <IfModule mod_php5.c> php_value include_path ".:/usr/local/lib/php" php_admin_flag engine on </IfModule> <IfModule mod_php4.c> php_value include_path ".:/usr/local/lib/php" php_admin_flag engine on </IfModule> Caution
PHP constants do not exist outside of PHP. For example, in
httpd.conf you can not use PHP constants
such as Changing PHP configuration via the Windows registry
When running PHP on Windows, the configuration values can be
modified on a per-directory basis using the Windows registry. The
configuration values are stored in the registry key
Other interfaces to PHPRegardless of how you run PHP, you can change certain values at runtime of your scripts through ini_set. See the documentation on the ini_set page for more information. If you are interested in a complete list of configuration settings on your system with their current values, you can execute the phpinfo function, and review the resulting page. You can also access the values of individual configuration directives at runtime using ini_get or get_cfg_var. |