Even trying to run asynchronously file.php from one.php, and even so to pass the parameter $ user_id. But this query does not work:

exec("file.php $user_id > /dev/null 2>/dev/null &"); 

Although even like this exec("file.php") does not work. What could be the problem?

PS: file.php and one.php are in the same directory (not the root), and the hoster says that the feature is on ..

  • file.php and one.php are in the same directory (not the root) - and this does not guarantee that the OS will search for file.php in the same directory, calculate and use the absolute path. - etki

1 answer 1

I suppose the reason is that php is not a program. You need to call the php interpreter, passing it the name of the file with the script as an argument.

  • Similarly, this is the console! - Kula Hula