Question: how to fix could not initialize photoshop because an unexpected end-of-file was encountered?
Answer: That just means that the file is corrupted or truncated for some reason and cannot be read. That could refer to your preferences, or a file recovered after a crash. Try launching with command-option-shift held down to reset Photoshop's preferences.