I don't have any access to the php.ini and httpd.conf files. Are there any procedure to override (or add some) settings of php.ini and httpd.conf files from my php application?
You can use ini_set()
for some settings or by modifying the setting via .htaccess
http://www.php.net/manual/en/ini.list.php
The changeability of ini settings using these methods varies depending on the variable (see "Changeable" column). This page explains what each of those PHP_INI_*
mean.
For settings in httpd.conf
(eg: that pertain to Apache itself rather than PHP), you'll need to use .htaccess
files. But of course your server's AllowOverride
has to allow you to use them. Contact your hosting provider for information on this.
For Apache configuration: this can (for certain settings) be done using .htaccess
files:
.htaccess
files (or "distributed configuration files") provide a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory, and the directives apply to that directory, and all subdirectories thereof.
You may be unable to change certain settings using .htaccess
files; the directives that you can use are specified in the main Apache configuration using AllowOverride
directives.
For PHP settings: this can be done using the ini_set
function:
Sets the value of the given configuration option. The configuration option will keep this new value during the script's execution, and will be restored at the script's ending.
This appendix shows you which settings can be changed from scripts.
For apache, use .htaccess
, which will grant you control over much of what would httpd.conf
would have given you.
For PHP look here: PHP: How to change configuration settings, one of the method is having settings put also in the .htaccess
file (when certain php modules exist in the server).