I am using ubuntu . i run python script from php function.I want to run the python in background (Asynchronous) . I try following codes. the codes are working but the control is waiting for full python script to completed. After that only moves to next line in php file.
shell_exec("nohup python2.7 /var/www/html/pythonproject/python.py /var/www/html/file 100525 &");
exec("nohup /usr/bin/python2.7 /var/www/html/pythonproject/python.py /var/www/html/file 100525 &");
I Found Solution it is working for me
exec("/usr/bin/python2.7 /var/www/html/pythonproject/python.py /var/www/html/file 100525 > /dev/null 2>/dev/null &")