Firstly, have a backup of your config, then:
If the base FreeBSD and pfSense script PHP… files are fine, but you just made some config change that messed something up, restore the known-good config from backup.
If files in the base FreeBSD or pfSense scripts... are gone wrong (deleted, corrupted, disk hardware problem...), then do a full install, then restore your config.
(If the base system has been corrupted in some way, there is not much to be gained messing about trying to get back the files you know are deleted/corrupted... You will never be quite sure if everything is right. Much easier to just reinstall and restore the config.