Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
php cli shebang line echos but only on one machine [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
tld
l33t
l33t


Joined: 09 Dec 2003
Posts: 773

PostPosted: Thu Sep 02, 2010 3:09 pm    Post subject: php cli shebang line echos but only on one machine [SOLVED] Reply with quote

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:

Code:
cat ptest
#!/usr/bin/php
<?php
print "OK...\n";
?>


On one machine:
Code:
./ptest
OK...


But on the other:
Code:
./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?

Tom


Last edited by tld on Sat Sep 04, 2010 12:29 pm; edited 1 time in total
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Sat Sep 04, 2010 7:54 am    Post subject: Reply with quote

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?
_________________
The End of the Internet!
Back to top
View user's profile Send private message
tld
l33t
l33t


Joined: 09 Dec 2003
Posts: 773

PostPosted: Sat Sep 04, 2010 11:57 am    Post subject: Reply with quote

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:

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


I'm totally stumped.

Tom
Back to top
View user's profile Send private message
tld
l33t
l33t


Joined: 09 Dec 2003
Posts: 773

PostPosted: Sat Sep 04, 2010 12:30 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum