A
A
Anton2015-03-29 19:57:17
linux
Anton, 2015-03-29 19:57:17

Why does exec start a process that is not running?

Hello!
If you run the command in the terminal:

nohup php -f /path/to/file.php > /dev/null 2>&1 & echo $!

Then the script will be executed successfully, its pid will be displayed and it will hang in the processes, performing its task.
But if you do the same in another php script through the exec function, then the /path/to/file.php script will also hang in processes, as if it is performing its task, but it is not.
In short, both launch options are identical, except for the moment that after running the command from the php console, the script executes its code, while this does not happen in the second launch option.
What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
whats, 2015-03-29
@whats

Rights. You can display information on running the script and not null it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question