Web hosting enables your websites visibility and online presence. Apart from mere hosting it also performs important tasks like enhancing security and makes your website safe and secured. PHP is a scripting language used for web development and programming. PHP code is actually embedded into html source code and processed and interpreted by a php enabled processor-module. Php can be easily deployed on most web servers used for hosting and it has a important feature that it works as interpreter on different OS (operating system) and available freely.
What is .htaccess File?
A .htaccess file is known as hypertext access which is a configuration file used in directory level and well supported by different web servers. PHP4 & PHP5 option via .htaccess file can be changed and is useful for performing essential hosting based task. Ini-set () function can be used to set a scripts directives value by providing the “CHANGEABLE” attribute of Php, which is PHP_INI_ALL or PHP_INI_USER. Now you require adding “options” to your AllowOverride specifications for web server or directory to make this setting to work in .htaccess file. In recent times, the .htaccess file is considered important and it can set priority for configuration settings like CGI handlers and character set. But it is significant to note that .htaccess file cannot change all PHP options. It can change the option which is noticeable with php command PHP_INI_ALL or by php command PHP_INI_PERDIR. PHP_INI_SYSTEM cannot be changed by .htaccess.
The syntax is simple and pretty easy to use.
php_flag [variable_name] [value]
.htaccess files should not be use if you do not have full access to the hosting server configuration file. People have a notion, which may be regarding as misconception that .htaccess files perform the task of user authentication but this is not correct and user configuration can be set by configuration file located in the main hosting server.
PHP4 & PHP5 option via .htaccess file is perform additional tasks for your web server. You can even change the setting by using rule set in configuration files (e.g. .htaccess files and httpd.conf) of Apache when php is being used as an Apache server module. Allowoverride option like “AllowOverride All” command does the needful trick. Apart from this, there are other Apache rules set which will help you to change and modify the PHP configuration inside the configuration files of Apache server.
Php_value name value is important in this regard. You can set the value, for example of a specified rule set, which can be altogether used with PHP_INI_ALL and PHP_INI_PERDIR. And you can use none as value to clear any previously assigned value.
Purpose of .htaccess file
Different Content Management Software (cms) are using PHP4 & PHP5 option via .htaccess file efficiently to perform different tasks. For example increase of uploading file size can be enhanced as most cms site has limit on uploading file size, by default php will restrict the upload setting upto 2 MB. It can be done by tuning PHP settings like ‘upload_max_filesize’ and another one is ‘post_max_size’. The following setting, post_max_size is set the limit for all the file and content of your upload. Many people use upload_max_filesize to allow more than one file upload but which is not essential.
You can increase the uploading size by changing these to PHP variables in php.ini or .htaccess depending on your host.
You can increase the file upload limit size to 10 MB by following this
Add few lines in php.ini file.
upload_max_filesize = 10M and
post_max_size = 10M
and also add lines to your .htaccess in cms like drupal.
Php-value-upload_max-filesize 10M and
advantage of using .htaccess
PHP4 & PHP5 option via .htaccess file helps you to prevent exploit attempts with apache .htaccess files. In most servers this option is not enabled. The advantage of using .htaccess is that you can set password protect for important directories to restrict unauthorized access to directories by IP address and depending on the configuration of server. Thus PHP4 & PHP5 option via .htaccess file gives you lots of security and prevents unauthorized access to your web server.
For more articles on web-hosting visit HostGatorDiscounts.com