I want to call a process once user submit the form. I am using codeigniter so the process will be called from the url(www.example.com/index.php/update_users
). I had read the code form the thread "php execute a background process" for shell_exec()
but it gives me blank output so I am not able to debug it also. Is there any other way to do so? or any how we can run the shell_exec
. I don't want to execute any linux command, all I need to do is call a url in background so that I can update my database silently because it's taking too much time(approx 45 sec) if running in browser.
Asked
Active
Viewed 108 times
0
-
That's not how you should do it. Following MVC pattern you should simply call the function connected with the respective route from your php code. – Sotiris Kiritsis Sep 29 '15 at 12:11
1 Answers
0
You might want to pipe the exec's output into a log file;
exec('/usr/bin/myprogram > /tmp/myprogram-debug.log 2>&1');
You can then read it from there once it finished (or log it on the go, using tail -f (tail -f /tmp/mypgrogram-debug.log
)

Rob
- 4,927
- 4
- 26
- 41