# php cli shebang line echos but only on one machine [SOLVED]

## tld

This defies explanation.  I have one machine where use of the shebang line in php scripts (to allow direct execution of the script), while fully functinal, displays the shebang line to the screen.  On two other machines with the exact same version of php, the same cli php.ini, and the same USE flags it doesn't.

Here's a test script:

```
cat ptest

#!/usr/bin/php

<?php

print "OK...\n";

?>

```

On one machine:

```
./ptest

OK...

```

But on the other:

```
./ptest

#!/usr/bin/php

OK...

```

As you can see, while the shebang line is obviously working and finding the parser program, it echos.

I'm dumbfounded.  What on earth could cause that?

TomLast edited by tld on Sat Sep 04, 2010 12:29 pm; edited 1 time in total

----------

## truc

Did you create the ptext script on each host, or did you just copy it from one to an other?

what's the results of file ptest on each host?

----------

## tld

That was my first thought.  I rsync'ed it from one machine to the others, and the scripts are identical.  All of them show exactly:

```
file ptest

ptest: a /usr/bin/php script text executable

```

I'm totally stumped.

Tom

----------

## tld

Found it: There was in fact one difference between the servers where it worked correctly and the ones where it didn't. On the ones that were displaying the shebang line I had the NuSphere PhpExpress extension being loaded...this was apparently altering that behavior.

Tom

----------

