How to remove comments and empty lines from a `php.ini`?

bash
command-line
php

(Dmitry Fedyuk) #1
sed -i '/^;/ d' php.ini
sed -i '/^\s*$/d' php.ini

How to remove the `#` comments and empty lines from a configuration file?
(Dmitry Fedyuk) #2

See also: How to remove the # comments and empty lines from a configuration file?