How to Alter PHP Apache Module Configuration Settings

How to Alter PHP Apache Module Configuration Settings

When you are making use of PHP as a module for Apache, you could make use of the directives in files used for configuring Apache, to change the settings used for configuring it. Some examples are the files htaccess and httpd.conf. In order to do this, you will be needing the two privileges: The “AllowOverride All” and “AllowOverride Options”.

Also, there are a set of directives of Apache which would give you room to change the configurations for PHP from inside the files used in configuring Apache. You can do this with the files below:

The php_value name value:

This is used to set the selected directive value and you can utilize it only with directives of the PHP_INI_ALL and PHP_INI_PERDIRtype. To be able to delete a value which you set earlier, in the b=value space, put none. You should also take great care to avoid putting php_value when you configure the values for Boolean, you should make use of the php_flag as shown below:

The php_flag name on|off:

You can utilize this when you wish to set a configuration directive for Boolean. Note that you can only utilize this with the directives of PHP_INI_ALL and PHP_INI_PERDIR type that you can use it.

The php_admin_value name value:

This is used to set the specified directive value. Note that you cannot make use of this in any files of .htaccess and either ini set () or .htaccess can’t override any type of directive which has been set using php_admin_value. Also, in order to delete a value which has been set previously, insert the new value as “none”.

The php_admin_flag name on|off:

This is made use of when you wish to wish to set a configuration directive for Boolean. You should take care to note that you cannot use this in any file of “.htaccess”. Also, ini set () or .htaccess can’t override any type of directive which has been set using php_admin_flag.

An Illustration to Show You How to Configure Apache

<IfModule mod_php5.c>
php_valueinclude_path".:/usr/local/lib/php"
php_admin_flag engine on
</IfModule>
<IfModule mod_php4.c>
php_valueinclude_path".:/usr/local/lib/php"
php_admin_flag engine on
</IfModule>

Be Cautious of the Following:

Note that you cannot find any PHP constants outside PHP. An example is when you can’t use the PHP constants like the”E_ALL or E_NOTICE ” when setting the directive used for reporting errors in httpd.conf due to the fact that they won’t make any sense and will produce a “0” evaluation. Instead, make use of values associated to bitmask. You can only utilize it in php.ini.

How To Alter PHP Configuration Utilizing Windows Registry

The Windows Registry can be used when in modifying the values used in configurations on a per-directory pattern when PHP is run on the Windows platform. It is in the registry key, “HKLMSOFTWAREPHPPer Directory Values” that the values used in configurations are stored and then, in those sub-keys which correspond to the names of the path.

An illustration of this is when you are storing the values used in configuring the directory, “c:inetpubwwwroot “, they will go to the key

"HKLMSOFTWAREPHPPer Directory Valuescinetpubwwwroot".

Thus, it will cause the directory settings in being active for whichever script that runs from any of its subdirectory or directory. Those values that are under the key is mandated to make use of both the configuration directive’s name for the PHP and the name of the string value.

There is also no parsing of the constants of the PHP that are in the values. Hence, it is only the values used in configurations that are changeable in PHP_INI_USER that have this setting, the values of PHP_INI_PERDIRcan have this setting.

Other Interfaces To PHP

Through using ini set(), despite how PHP is run, there are some particular values that you can make changes to at your script’s runtime. If you wish to get on your device, a comprehensive settings list for configurations and those of their values currently updated, make use of the function “ phpinfo()” and ensure the page which appears is reviewed. Also, you can use the “get cfgvar”or the “ini get()”to gain access to the individual directives’ values, used in configurations at runtime

Conclusion

This article provided you with tips on how you can configure PHP in Apache and how you can alter PHP module in Window registry. You should be able to replicate these steps if you followed the steps and tips strictly. Still having issues, don’t be disheartened. We are here to answer all the questions you may have and see that your problem is properly handled.

Check out these top 3 Windows hosting services:

Ultahost
$2.90 /mo
Starting price
Visit Ultahost
Rating based on expert review
  • User Friendly
    4.3
  • Support
    4.8
  • Features
    4.5
  • Reliability
    4.0
  • Pricing
    4.8
Kamatera
$4.00 /mo
Starting price
Visit Kamatera
Rating based on expert review
  • User Friendly
    3.5
  • Support
    3.0
  • Features
    3.9
  • Reliability
    4.0
  • Pricing
    4.3
IONOS
$1.00 /mo
Starting price
Visit IONOS
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.3

How to Install MySQL on a Windows Web Server Running Apache

This tutorial will show you how to install the MySQL database on a Windows serve
3 min read
Michael Levanduski
Michael Levanduski
Expert Hosting Writer & Tester

How to Install OpenCart on an Ubuntu 18.04 Server or VPS with Apache, MariaDB and PHP 7

In this how-to, you’ll learn how to install OpenCart, an open source shopping ca
3 min read
Angela Olaru
Angela Olaru
Senior Writer & Hosting Expert

How to Configure PHP Versions and Options on cPanel

This guide will show new webmasters about switching to different PHP versions an
2 min read
Avi Ilinsky
Avi Ilinsky
Hosting Expert

How To Install Apache, MySQL & PHP on an Ubuntu 18.04 VPS or Dedicated Server

This article shows users how to setup PHP, Apache web server and MySQL database
4 min read
Idan Cohen
Idan Cohen
Marketing Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top