Skip to content

Prevent Overwriting PHP Settings By An Application

Assumptive you have a apache webserver and you need to deal with an old application that fills up your log file with many strict entries. You need to prevent your "error_reporting" level to get overwritten.
You can achieve this by adding the following line in your apache httpd.conf.

php_admin_value error_reporting 22517

It is important you are using "php_admin_value" (or "php_admin_flag" when needed) instead of "php_value" to set the value. If you use "php_admin_value", you prevent the value gets overwritten by the ".htaccess" or a "ini_set()" call from your application.

Want to know more? Here are some links fitting to this topic.

Configuration Format Converter

Since i have to deal with a lot of configuration formats in php- or webapplications, i decided to write a conversion tool.

Today i'm happy to announce the version 1.0.0.

It is a console application (symfony/console based) and provides one command called convert. convert expects two arguemts, source and destination. The command has an option --force if destination already exists.
What do you have to provide as source or destination? For the source, you have to provide a relative path to the source configuration file. For the destination, you have to provide a relative path with file name that should contain the converted source configuration file content.

Since the conversation depends on a component, it is restricted to this capabilities. Good to know, i also maintain that component so if this cli application needs additional features, the component should be extended quite soon ;-).

The command line configuration format converter is available on github.com or via packagist.org.

Since the formater component is using the php array as exchange format between the available formats, you should know that the configuration files are underlying some restrictions. I'm working hard to create a wiki for the convertion component.

Enjoy it and feel free to report bugs or fork it.