Knowledge Base

Using PHP directives in custom .htaccess files

PHP allows you to control many aspects of your web site by using directives in .htaccess files. Learn about some of these directives here.

These articles assume that you have already set up a custom .htaccess file. If you have not already done this, please read this article first.
PHP error message settings in an .htaccess file

You can control whether or not PHP displays error messages to web site visitors by using the display_errors directive in a custom .htaccess file. Learn how here.

Enabling and disabling PHP error logging using an .htaccess file

You can use the log_errors and error_log directives in a custom .htaccess file to configure PHP error logging, and this article shows you how.

Setting the PHP time zone in an .htaccess file

By default, A2 Hosting's servers are set to use US Eastern Standard Time. Learn how to change the PHP time zone setting for your web site here.

Setting the PHP maximum execution time in an .htaccess file

By default, the maximum execution time for PHP scripts is set to 30 seconds, but you can change this interval by using the max_execution_time directive.

Setting the register_globals directive in an .htaccess file

You can enable and disable the register_globals directive in a custom .htaccess file. This article only applies to PHP 5.3 and earlier versions.

Setting the magic quotes directive in an .htaccess file

You can enable and disable the magic quotes directive in a custom .htaccess file. This article only applies to PHP 5.3 and earlier versions.

Setting the PHP maximum upload file size in an .htaccess file

You can change the maximum upload file size for PHP scripts by using the upload_max_filesize and post_max_size directives in an .htaccess file.

Setting the allow_url_fopen PHP directive

You can set most PHP directives in an .htaccess file. However, the allow_url fopen directive is a special case. Please note that this article only applies to managed VPS and Flex Dedicated Server accounts.

Setting the PHP script memory limit in an .htaccess file

By default, the memory limit for PHP scripts is set to 128 megabytes, but you can change this value by using the memory_limit directive in a custom .htaccess file.

Setting the max_input_vars directive in an .htaccess file

By default, the maximum number of input variables for PHP scripts is set to 1000, but you can change this amount by using the max_input_vars directive in an .htaccess file.

Setting the output_buffering directive in an .htaccess file

By default, PHP does not buffer output during script processing. However, you can modify this behavior by using the output_buffering directive in an .htaccess file.