Re: bad interpreter error from CLI
| From: | Thijs Lensselink | Date: | Fri, 13 Mar 2009 14:44:35 +0000 |
| Subject: | Re: bad interpreter error from CLI | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-289999@lists.php.net to get a copy of this message | ||
Thodoris wrote:
> Hi gang,
> I am trying to run a script from cli which goes like this:
>
> #!/usr/bin/php
> <?php
> passthru("printenv");
> ?>
>
> The error I get is this:
> /usr/bin/php^M: bad interpreter: Permission denied
>
> the php binary is indeed in this location and when I run the same script
> like this:
> php -f test.php
>
> it works properly. I will have to mention that the executable flag is
> set in the file's permissions.
>
> Any ideas why is this happening?
>
> php -v gives me:
> PHP 5.1.6 (cli) (built: Nov 12 2008 11:22:34)
> Copyright (c) 1997-2006 The PHP Group
> Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
>
Does the filesystem the scripts are on by any chance has 'noexec' set?
$ mount
(rw,noexec,nosuid,nodev)