| 发表于:2008-01-22 11:40:00 楼主 |
问题如下:我用pear(aaa.pl)写了一个发送邮件的程序,在独立服务器上(liunx)测试成功,但是在虚拟空间上(因为没有权限更改虚拟空间),我需要写一个程序,执行后在php后台调用进程,不耽误前台的使用,我调用了下面的程序,为什么不好用呢? <?php if(launchbackgroundprocess('aaa.pl')) { print 'successfully launched background process'; } function launchbackgroundprocess($call) { // windows if(is_windows()) { pclose(popen('start /b '.$call.'', 'r')); } // some sort of unix else { pclose(popen($call.' /dev/null &', 'w')); } return true; } function is_windows() { if(php_os == 'winnt' ¦ ¦ php_os == 'win32') { return true; } return false; } ?> |
|
|
|
|