The following worked for me:
cd /etc/php5/cli/conf.d sudo perl -pi.bk -e 's/(\s*)#/\1;/' *ini sudo mkdir bk sudo mv *.bk bk
Which only catches comments at the start of a line; also, backups of the original files are in the /etc/php5/cli/conf.d/bk directory.
The following worked for me:
cd /etc/php5/ cli/conf. d
sudo perl -pi.bk -e 's/(\s*)#/\1;/' *ini
sudo mkdir bk
sudo mv *.bk bk
Which only catches comments at the start of a line; also, backups of the original files are in the /etc/php5/ cli/conf. d/bk directory.