Bad interpreter: No such file or directory

I have PHP scripts that start off as so:

#!/usr/local/bin/php
<?
// php code ...
?>

They’re chmod a+x. “which php” returns “/usr/local/bin/php”. Used to work just fine using “./script.php”. Now, that gives this error “bad interpreter: No such file or directory”. Weirder still is that “php script.php” executes the script fine. PHP appears to be the cli version:

[admin]# /usr/local/bin/php -v
PHP 4.3.4 (cli) (built: Dec  9 2003 03:07:33)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies

Anybody know what the problem is?

Did you try taking out this line:
#!/usr/local/bin/php
?

Also maybe change <? to <?php

Did you try taking out this line:
#!/usr/local/bin/php
?

That’s required (otherwise it just gives more errors).

Also maybe change <? to <?php

Yep, tried that (didn’t expect it to matter).

I love cross-platform differences (especially MS’s):

Are you sure the files have not been edited with a Windows editor and
therefore have CR-LF line endings? If they do, it will be looking for
/usr/local/bin/php\r

I used dos2unix on the PHP files and they work fine now.