参考:http://stackoverflow.com/questions/10330294/php-background-process-not-working
一个往数据库中插入数据的脚本read.php
前台直接执行:php read.php 可以正常执行,但是如果是: php read.php & 则没有任何反应,进程在后台,但是没有正常执行。
用下面的方法试试:
nohup php -f read.php &
弹出提示:
nohup: ignoring input and appending output to `/home/andy/nohup.out'
回车之后忽略,之后看到脚本已经正常运行了~~~
原因不明。。。