You're definitely on the right track:
1. You really want PHP5 (not PHP4, if you can avoid it)
2. You *should* be able to call PHP5 from a command line or script... only now it will now be called "php5" (instead of the old name, "php").
Verify that PHP5 is installed and available from a terminal window:
3. Now you've got a choice:
a) change your script (to use "php5" instead of "php")
b) create a symbolic link to alias php5 to "php"
I vote for "a)". The syntax for a symbolic link would be:
EXAMPLE: ln -s /usr/bin/php5 /usr/bin/php
4. Perhaps maybe when you edited your script, you found some (but not all) instances of "php", and you simply need to find and change the rest?
'Hope that helps .. pSM