Jump to content

Passing Arguments


pgrevents

Recommended Posts

Ok what I am trying to do is send an argument to a perl file to execute im making headway but there is an error here is my code

<? php shell_exec('/usr/bin/php get_iplayer  --info > testfile.txt'); ?>

 

The error is getting printed to a text file thats what the > testfile.txt is the error is

X-Powered-By: PHP/5.2.8
Content-type: text/html

<br />
<b>Parse error</b>:  syntax error, unexpected T_STRING in <b>/home/steve/public_html/get_iplayer/get_iplayer</b> on line <b>1610</b><br />

 

No only when I put the /usr/bin/php in the shell_exec do I get any printout whatsoever.

 

I know this script works as I use putty to print that command is there anything on the php side to eliminate this. I think the reason it does error is cause of the usr/bin/php but thats the only line that will make the script react to anything outside shell

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/162471-passing-arguments/
Share on other sites

Ok what I am trying to do is send an argument to a perl file to execute im making headway but

 

You say you are trying to execute a perl file, but you are running /usr/bin/php.  I'm not sure, but I really don't think PHP will understand PERL.  Is that a typo in your question or just running the wrong interpreter?

Link to comment
https://forums.phpfreaks.com/topic/162471-passing-arguments/#findComment-857584
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.