If you are in a shared server environment, and you don’t have access to the php.ini file,  or you want to set php parameters on a per-site basis, you can use the .htaccess file (when running on an Apache webserver).

For instance, in order to change the max_execution_time value, all you need to do is edit .htaccess (located in the root of your website, usually accesible by FTP), and add this line:


php_value max_execution_time 120

where 120 is the number of seconds you wish to set the maximum execution time for a php script.
There are 2 types of variables that can be set:

1. The values of  specific directives can be set using php_value name value. Ex:


php_value memory_limit 128M

2.Boolean varibles can be set using a php_flag name on|off directive. Ex:


php_flag magic_quotes_gpc Off

Other values that can be changed through the .htaccess are:
allow_url_fopen
allow_url_include
arg_separator
arg_separator.input
arg_separator.output
asp_tags
default_charset
default_mimetype
default_socket_timeout
define_syslog_variables
detect_unicode
display_errors
display_startup_errors
docref_ext
docref_root
engine
error_append_string
error_log
error_prepend_string
error_reporting
gpc_order
html_errors
http.allowed_methods

log_errors
log_errors_max_len
magic_quotes_gpc
magic_quotes_runtime
max_execution_time
max_input_time
memory_limit
msql.allow_persistent
mysql.allow_persistent
mysql.cache_size

mysql.connect_timeout
mysql.default_host
mysql.default_port
mysql.max_persistent
post_max_size
register_globals
register_long_arrays
safe_mode
sendmail_from
session.auto_start
session.cache_expire
session.cache_limiter
session.use_cookies
short_open_tag
smtp_port
upload_max_filesize
url_rewriter.tags
user_agent
user_dir
zlib.output_compression

Note: You will need “AllowOverride Options” or “AllowOverride All” privileges in order to be able to use htaccess to modify php variables.