我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何杀死从终端mac osx使用线程的php进程

I have run php script in terminal

php test.php

I always kill executing of the script by 'ctrl+c' or

kill pid

But now this script doesn't kill. I think it's because I use Thread in my script.

Does anyone know how I can stop executing of the script?

UPD code of the php script

class TestThread extends Thread {

    public function __construct() {

    }

    public function run() {
        while(true) {
            // Do something
            sleep(5);
        }
    }
}

$thread = new TestThread();
$thread->start();

近期文章

  • 语法错误,格式错误的JSON SLIMCD
  • ftp_get()损坏大文件下载
  • Laravel 5:使用带有标准Paginate结果的简单分页箭头
  • json从result.php文件url解析
  • 破坏的base64中的字符集不正确
  • 通过php获取OSM中的'maxspeed'标签
  • 将PHP变量作为参数传递给XSL
  • OS X Yosemite - 无法登录MySQL服务器
  • 含义:mssql_rows_affected返回-1?
  • Jquery文件上传JSON空错误
  • XPath子串 - 后帮助/查询/评估?
  • Bootstrap缩略图滑块加载动态内容
  • 如何在PHP中拆分不同的日期格式?
  • 将文件上传到Apigility时“指定了无效的内容类型”
  • CSS没有在Woocommerce Wordpress模板文件中执行
  • php,chunked transfer encoding:失败的http连接
  • 使用mysqli调用非对象的成员函数
  • 如何将数据库信息作为标题放在表中
  • 如何在PHP中使用dbase优化.dbf文件的研究?
  • PHP class_exists()失败,代码相同,环境略有不同

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华