If i run shell_exec(php file) , will it activate the shell_execution and continue with the php file, or will it try to complete everything in the shell_executed php file first, then run the rest of the php file that executed it.
2 Answers
shell_exec(), as stated in the Documentation, will return the complete output as a string. So it has to be a "blocking" function. That means it will block the execution of the rest of your code until it is complete.
Depending on your command that you want to execute, you may want to force the process to run in the background with the & character at the end of the command. This is assuming ofcourse that you are running on a unix based server.
1 Comment
Darius
Thank you for that formal definition, I had removed the "&" from the code I was using and I didn't realize that's what it did, perfect. Thank you, got what I needed.