修改日志路径后报错,报错无法创建/log/workerman.log

wangerwu

问题描述

这里详细描述问题

程序代码

截图

报错信息

\runtime/log/workerman.log because No such file or directory in file D:\WebmanProjects\项目根目录\vendor\workerman\workerman\Worker.php on line 610
chmod(): No such file or directory in file D:\WebmanProjects\项目根目录\vendor\workerman\workerman\Worker.php on line 611
----------------------

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

发现是没有自动创建log目录,所以无法创建workerman.log日志,但是相关配置都已经将路径修改为/log/

截图

139 1 0
1个回答

walkor

webman可能不是最新的,升级下
composer require workerman/webman-framework

  • wangerwu 10天前

    执行composer update,之后再次重试还是一样。

  • walkor 10天前

    执行 composer info | findstr webman-framework 发下版本号

  • wangerwu 7天前

    workerman/webman-framework v1.5.16 High performance HTTP Service Framework.

  • walkor 7天前

    workerman也升级下

  • walkor 7天前

    下次提问把系统 webman workerman版本都发下,尝试用最新版本,这样大家都节省时间,免得把时间都浪费版本询问,升级上

  • wangerwu 5天前

    尝试 “composer create-project workerman/webman” 重新创建项目。
    然后修改 config/server.php中的日志路径 logs为log
    'stdout_file' => runtime_path() . '/log/stdout.log',
    'log_file' => runtime_path() . '/log/workerman.log',

    启动时仍然报错,于我所描述的问题一致。
    D:\Temp-D\webman>php windows.php

    touch(): Unable to create file D:\Temp-D\webman\runtime/log/workerman.log because No such file or directory in file D:\Temp-D\webman\vendor\workerman\workerman\Worker.php on line 610
    chmod(): No such file or directory in file D:\Temp-D\webman\vendor\workerman\workerman\Worker.php on line 611
    ---------------------------------------------- WORKERMAN -----------------------------------------------
    Workerman version:4.1.15 PHP version:8.0.2
    ----------------------------------------------- WORKERS ------------------------------------------------
    worker listen processes status
    touch(): Unable to create file D:\Temp-D\webman\runtime/log/workerman.log because No such file or directory in file D:\Temp-D\webman\vendor\workerman\workerman\Worker.php on line 610
    chmod(): No such file or directory in file D:\Temp-D\webman\vendor\workerman\workerman\Worker.php on line 611
    webman http://0.0.0.0:8787 1 [ok]
    touch(): Unable to create file D:\Temp-D\webman\runtime/log/workerman.log because No such file or directory in file D:\Temp-D\webman\vendor\workerman\workerman\Worker.php on line 610
    chmod(): No such file or directory in file D:\Temp-D\webman\vendor\workerman\workerman\Worker.php on line 611
    monitor

  • walkor 5天前

    手动建一个log目录吧

  • wangerwu 5天前

    是的,作为临时解决方案。

🔝