webman 在windows环境下rename()报错

408614904@qq.com

问题描述

这里详细描述问题
ErrorException: rename(D:\dw_pro\runtime/sessions\8b49e29e6a167cf065f655c18752a4.79313551,D:\dw_pro\runtime/sessions\session_4e7f6e9c927dd9414f423af05245a13c)

程序代码

public function write($session_id, $session_data)
    {
        $temp_file = static::$_sessionSavePath . uniqid(bin2hex(random_bytes(8)), true);
        if (!\file_put_contents($temp_file, $session_data)) {
            return false;
        }
        return \rename($temp_file, static::sessionFile($session_id));
    }

报错信息

��һ����������ʹ�ô��ļ��������޷����ʡ� (code: 32) in D:\dw_pro\vendor\workerman\workerman\Protocols\Http\Session\FileSessionHandler.php:94
Stack trace:
#0 [internal function]: support\App::{closure}(2, 'rename(D:\\dw_pr...', 'D:\\dw_pro\\vendo...', 94, Array)
#1 D:\dw_pro\vendor\workerman\workerman\Protocols\Http\Session\FileSessionHandler.php(94): rename('D:\\dw_pro\\runti...', 'D:\\dw_pro\\runti...')
#2 D:\dw_pro\vendor\workerman\workerman\Protocols\Http\Session.php(312): Workerman\Protocols\Http\Session\FileSessionHandler->write('4e7f6e9c927dd94...', 'a:1:{s:5:"admin...')
#3 D:\dw_pro\vendor\workerman\workerman\Protocols\Http\Session.php(432): Workerman\Protocols\Http\Session->save()
#4 D:\dw_pro\vendor\workerman\workerman\Protocols\Http.php(191): Workerman\Protocols\Http\Session->__destruct()
#5 D:\dw_pro\vendor\workerman\workerman\Connection\TcpConnection.php(329): Workerman\Protocols\Http::encode(Object(support\Response), Object(Workerman\Connection\TcpConnection))
#6 D:\dw_pro\vendor\workerman\webman-framework\src\App.php(643): Workerman\Connection\TcpConnection->send(Object(support\Response))
#7 D:\dw_pro\vendor\workerman\webman-framework\src\App.php(141): Webman\App::send(Object(Workerman\Connection\TcpConnection), Object(support\Response), Object(support\Request))
#8 D:\dw_pro\vendor\workerman\workerman\Connection\TcpConnection.php(646): Webman\App->onMessage(Object(Workerman\Connection\TcpConnection), Object(support\Request))
#9 D:\dw_pro\vendor\workerman\workerman\Events\Select.php(311): Workerman\Connection\TcpConnection->baseRead(Resource id #343)
#10 D:\dw_pro\vendor\workerman\workerman\Worker.php(1485): Workerman\Events\Select->loop()
#11 D:\dw_pro\vendor\workerman\workerman\Worker.php(1402): Workerman\Worker::forkWorkersForWindows()
#12 D:\dw_pro\vendor\workerman\workerman\Worker.php(560): Workerman\Worker::forkWorkers()
#13 D:\dw_pro\vendor\workerman\webman-framework\src\support\App.php(131): Workerman\Worker::runAll()
#14 D:\dw_pro\start.php(4): support\App::run()
#15 {main}

截图报错信息里报错文件相关代码

这里粘贴截图

截图

操作系统及workerman/webman等框架组件具体版本

windows11 webman-admin 用的命令行启动

420 1 0
1个回答

walkor 打赏

估计是没权限向 D:\dw_pro\runtime/sessions 目录写文件

  • 暂无评论
×
🔝