If I've understood correctly, you shouldn't need #!/usr/bin/php
in your PHP script. Presuming you've got php
installed with the command available, try the below from command line:
sudo php path/to/script.php
...where script.php
contains only PHP code.