Re: bad interpreter: No such file or directory
| From: | Curt Zirzow | Date: | Fri, 23 Apr 2004 23:21:47 +0000 |
| Subject: | Re: bad interpreter: No such file or directory | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184484@lists.php.net to get a copy of this message | ||
* Thus wrote CSN (cool_screen_name90001@yahoo.com):
> 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". However, "php
> script.php" still executes the script fine. PHP
> appears to be the cli version:
You're php file has a ^M (dos line ending) at the end of your
scripts shbang line:
#!/usr/local/bin/php^M
open in vi and remove it, run a d2u tool on it, or if these files
are being transfered via ftp from a windows machine, be sure that
php files get transfered as ascii.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."