For PHP encoding you could use Zend Guard. We use it for all our projects and it works just fine. Keep in mind that this is a very pricy solution. A cheaper alternative is phpShield/ . I have no personal experience with this, but I read some raving reviews about it. On top of that, it's only $75 (opposed to $799 for Zend Guard for one year).
As for the JavaScript, there are several free JavaScript encoders/obfuscators available. These offer enough protection againt anybody reading or altering your script.