Error when terminal opens; no available formula
When Terminal starts and Your default shell is bash, those files are executed at startup:


.bash_profile
.profile
.bashrc


(there are also other files whih can be executed, but those are the most common)

Locate anything related with php5 in those files and resolve Your issue.