使用think自定义指令启动的
sudo -u www /www/server/php/74/bin/php /www/quantification/think Startws1
public function configure()
{
$this->setName('Startws1')
->addArgument('action', Argument::OPTIONAL, "start|stop|restart|reload|status|connections", 'start');
}
public function execute(Input $input, Output $output)
{
$action= $input->getArgument('action');
if ('start' == $action) {
$output->writeln('Starting Workerman server...');
$this->start();
}
}
start启动代码
/**
* 启动
* @access public
* @return void
*/
public function start()
{
$worker = new Worker();Worker::$daemonize = true;
$worker->onWorkerStart = function()
{
$con_url="xxxx";
$con = new AsyncTcpConnection($con_url);$con->transport = 'ssl';
//逻辑代码省略
}
Worker::runAll();
}
*win正常启动,放到liunx好像就不能,执行命令
Starting Workerman server...
------------------------------------- WORKERMAN --------------------------------------
Workerman version:3.5.31 PHP version:7.4.30
-------------------------------------- WORKERS ---------------------------------------
proto user worker listen processes status
tcp www none none 1 [OK]
--------------------------------------------------------------------------------------
Input "php think stop" to stop. Start success.
问题1.然后就进程掉了就think进程正常有人遇到吗,怎么解决的
问题2.workerman,怎么样可以正常使用tp6的db代码
同一个问题不要重复发帖
我害怕别人没看懂 我问题 所以我贴了代码
帖子可以重新编辑,也可以在回答处追加
好的,谢谢,刚用不懂