Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.
Encrypt the entire code (or at least an essential / 'main' php file), using a checksum of the required host name as the encryption key.
Then in a stub php file, do something along the lines of eval(your_favorite_decypt_function(the_encrypted_code,sha512(the_current_domain))).
Optionally, checksum-verify the decrypted result before eval'ing it to avoid random garbage on invalid domains.
Obviously this is not secure if people know on what domain this is supposed to run (in that case they can simply fake the host name). You could add some salt data stored in a database and/or local (non-http-accessible) file. That way, even if they get access to your php files and know on which server it's supposed to run, they still can't obtain the key necessary to run the code.