Escape the dot with a \
sed 's/foo\./foo_/g' file.php
If you find the combination of / and \ confusing you can use another 'separator' character
sed 's#foo\.#foo_#g
The 2nd character after the s can be anything and sed will use that character as a separator.