How to undo "sudo rm -rf /etc/apache2/other/+php-osx.conf"
You can't undo what you did, unless you can recover the files from a Time Machine backup. PHP probably stopped running because you removed files it needs.