drnycqxwz63508434 2011-01-21 13:54
浏览 218
已采纳

如何终止PHP exec()的运行命令启动?

I am using windows OS with wamp system installed.

My question is :

How to stop or terminate the running command of PHP exec() launched? In my situation,I will launch several command at the same time, and is it has something like IDs which corresponding,so I can stop the running command I want?

Thank you very much!!

  • 写回答

1条回答 默认 最新

  • doujie7346 2011-01-21 14:00
    关注

    I'm not sure if the same logic applies when using Windows OS, but you will want to do it in two steps.

    1) When you launch the process from php - you'll need to fork, so that your actual PHP doesn't hang. I'm used to doing it in perl, i'm sure php does it too.

    2) Whatever program you launch, if you can get its PID then store it in a database. If it's a unique executable name then just run taskkill /IM uniquename.exe or taskkill /PID #### if you have the PID

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办