Jump to content

Errors using shell_exec


The Little Guy

Recommended Posts

I am running a script from the command line, and I am doing this:

 

shell_exec('sh ~/processes/mini &');

 

When the "mini" file starts up, I get the following errors:

/home/ryannaddyps/processes/mini: line 2: ?php: No such file or directory
/home/ryannaddyps/processes/mini: line 3: include: command not found
/home/ryannaddyps/processes/mini: line 5: //--: No such file or directory
/home/ryannaddyps/processes/mini: line 7: syntax error near unexpected token `$clients,'
/home/ryannaddyps/processes/mini: line 7: `function send_all_message($clients, $socket, $buf){'

 

 

here is line 1-7:

#!/home/ryannaddyps/php/bin/php -q
<?php
include 'db.php';

//-- Functions

function send_all_message($clients, $socket, $buf){

 

both file have these permissions:

rwxr-xr-x

 

both files are exactly the same thing, only difference is filename, and they are both in the same directory.

 

Why am I getting those errors?

Link to comment
https://forums.phpfreaks.com/topic/193933-errors-using-shell_exec/
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.