When PHP is running as a CGI module, PHP settings cannot be modified through an .htaccess file.
If you would like to modify a PHP setting, you would have to use php.ini files. Unfortunately, php.ini files work only on a per-folder basis.
In other words, if you would like to apply custom PHP settings to two different folders, you would have to place separate php.ini files in each folder.
And when you need to apply custom PHP settings to many folders, placing a php.ini file in each folder can be bothersome.
Fortunately, there is a workaround which should apply to most applications. Instead of copying php.ini files recursively, you can specify the needed value only once.
Imagine you have a Joomla installation which spreads on many directories. You would like to allow remote file inclusion with the PHP setting allow_url_include. One way is to specify it in many php.ini files across all directories. The other way is to specify it in the main configuration.php file with PHP's function ini_set. The configuration.php file is included in all Joomla scripts and that's why your configuration change will take effect for all Joomla directories.
Thus all you have to do is add a line in the configuration.php file which says:
ini_set('allow_url_include','on');
Now this PHP directive will be valid for all Joomla subdirectories. Similarly, you can do so for almost any other application. Just make sure that you include the PHP directive in the main configuration file.