使用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好像就不能,執(zhí)行命令
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代碼