国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

php webman.phar start 異常 Uncaught ErrorException: include(build/webman.phar/config/plugin): failed to open stream: phar error: "config/plugin" is not a file in phar

Tinywan
isSuperAdmin(r.sub)PHP Fatal error:  Uncaught ErrorException: include(phar:///var/www》tinywan.cn/build/webman.phar/config/plugin): failed to open stream: phar error: "config/plugin" is not a file in phar "/var/www/micro.webman.tinywan.cn/build/webman.phar" in phar:///var/www/tinywan.tinywan.cn/build/webman.phar/vendor/workerman/webman-framework/src/Config.php:113
1851 3 0
3個回答

nitron

plugin是個目錄,沒法直接include吧

  • Tinywan 2022-02-25

    目前遇到的問題就是插件的使用phar打包,但是沒法使用

  • nitron 2022-02-25

    webman更新到1.2.4看看,我剛剛看了1.2.4Config做了點修改,針對phar的

  • yzh52521 2022-02-25

    上次試了一下打包 運行不了,一堆報錯

  • walkor 2022-02-25

    這個問題修復(fù)過,更新到 webman-framework v1.2.4 或者后續(xù)更高版本試下

  • Tinywan 2022-02-25

    升級后又是新的報錯

    #23 /var/www/micro.webman.tinywan.cn/build/webman.phar(5): require('phar:///var/www...')
    #24 {main}
    Error: Class 'Monolog\Handler\AbstractProcessingHandler' not found in phar:///var/www/micro.webman.tinywan.cn/build/webman.phar/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:26
    Stack trace:
    #0 phar:///var/www/micro.webman.tinywan.cn/build/webman.phar/vendor/composer/ClassLoader.php(571): include()
    #1 phar:///var/www/micro.webman.tinywan.cn/build/webman.phar/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('phar:///var/www...')
    #2 [internal function]: Composer\Autoload\ClassLoader->loadClass('Monolog\\Handler...')
    #3 phar:///var/www/micro.webman.tinywan.cn/build/webman.phar/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php(27): spl_autoload_call('Monolog\\Handler...')
    #4 phar:///var/www/micro.webman.tinywan.cn/build/webman.phar/vendor/composer/ClassLoader.php(571): include('phar:///var/www...')
    #5 phar:///var/www/micro.webman.tinywan.cn/build/webman.phar/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('phar:///var/www...')
    #6 [internal function]: Composer\Autoload\ClassLoader->loadClass('Monolog\\Handler...')
  • walkor 2022-02-25

    弄個新的webman項目,試下是否正常。我這沒有發(fā)現(xiàn)這個問題。

  • nitron 2022-02-25

    vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php 沒打包進去?

  • Tinywan 2022-02-25

    不清楚,下午搞個新的試試

  • Tinywan 2022-02-25

    下載的新框架也是這樣子

  • Tinywan 2022-02-25

    /var/www/webman # ./webman version
    Webman 1.2.4
    Webman-framework v1.2.4

北月妖王

說明一下:config/plugin/webman/console/app.php文件的exclude_pattern配置項是為了讓打包出來的文件相對小一些,去掉一些不需要的目錄,比如Test目錄,這是一個正則表達式,如果打包出來的phar文件有問題,請自己修改對應(yīng)的正則即可,因為每個人用到的依賴庫不一樣,如果不怕打包的phar文件太大,完全可以把exclude_pattern設(shè)置為null。
另外附上一張,剛才測試的結(jié)果圖。

  • Tinywan 2022-02-25

    vendor不打包,項目能運行?

  • 北月妖王 2022-02-25

    vendor肯定要打包進去的,exclude_pattern的存在可以忽略那些測試文件和文檔目錄,只打包進去項目必要的文件,你可以把它改成null,甚至可以exclude_files配置項目設(shè)置為空數(shù)組,再次進行打包

  • 北月妖王 2022-02-25

    exclude_pattern設(shè)置為null,即是不忽略整個項目的所有文件和目錄,exclude_files置空表示不忽略單個文件。
    也就是說exclude_pattern為null和exclude_files為空數(shù)組的時候,打包整個webman項目

  • yzh52521 2022-02-25

    新下載的框架可以用
    之前的就不可以用

    Stack trace:
    #0 phar:///Users/yuanzhihai/Sites/local/webman/build/webman.phar/vendor/php-di/php-di/src/Definition/Source/AnnotationBasedAutowiring.php(279): DI\Definition\Source\AnnotationBasedAutowiring->getAnnotationReader()
    #1 phar:///Users/yuanzhihai/Sites/local/webman/build/webman.phar/vendor/php-di/php-di/src/Definition/Source/AnnotationBasedAutowiring.php(68): DI\Definition\Source\AnnotationBasedAutowiring->readInjectableAnnotation(Object(ReflectionClass), Object(DI\Definition\ObjectDefinition))
    #2 phar:///Users/yuanzhihai/Sites/local/webman/build/webman.phar/vendor/php-di/php-di/src/Definition/Source/AnnotationBasedAutowiring.php(86): DI\Definition\Source\AnnotationBasedAutowiring->autowire('app\\middleware\\...')
    #3 phar:///Users/yuanzhihai/Sites/local/webman/build/webman.phar/vendor/php-di/php-di/src/Definition/Source/SourceChain.php(54): DI\Definition\Source\AnnotationBasedAutowiring->getDefinition('app\\middleware\\...')
    #4 phar:///Users/yuanzhihai/Sites/local/webman/build/webman.phar/vendor/php-di/php-di/src/Container.php(155): DI\Definition\Source\SourceChain->getDefinition('app\\middleware\\...')
    #5 phar:///Users/yuanzhihai/Sites/local/webman/build/webman.phar/vendor/php-di/php-di/src/Container.php(134): DI\Container->getDefinition('app\\middleware\\...')
    #6 phar:///Users/yuanzhihai/Sites/local/webman/build/webman.phar/vendor/workerman/webman-framework/src/Middleware.php(43): DI\Container->get('app\\middleware\\...')
    #7 phar:///Users/yuanzhihai/Sites/local/webman/build/webman.phar/support/bootstrap.php(60): Webman\Middleware::load(Array)
    #8 phar:///Users/yuanzhihai/Sites/local/webman/build/webman.phar/webman(6): require_once('phar:///Users/y...')
    #9 /Users/yuanzhihai/Sites/local/webman/build/webman.phar(5): require('phar:///Users/y...')
    #10 {main}
      thrown in phar:///Users/yuanzhihai/Sites/local/webman/build/webman.phar/vendor/php-di/php-di/src/Definition/Source/AnnotationBasedAutowiring.php on line 255
    
  • Tinywan 2022-02-25

    新下載的框架我這邊測試不行,不知道怎么回事?

  • 北月妖王 2022-02-25

    可以發(fā)一下config/plugin/webman/console/app.php文件的配置,包括你項目所需要的依賴庫,我安裝測試一下。
    如果可以的話,發(fā)一下打包后的phar文件,我解包出來看看少了哪些文件

  • Tinywan 2022-02-25

    app.php

    
    <?php
    return [
        'enable'            => true,
    
        'phar_file_output_dir'    => BASE_PATH . DIRECTORY_SEPARATOR . 'build',
    
        'phar_filename'     => 'webman.phar',
    
        'signature_algorithm'=> Phar::SHA256, //set the signature algorithm for a phar and apply it. The signature algorithm must be one of Phar::MD5, Phar::SHA1, Phar::SHA256, Phar::SHA512, or Phar::OPENSSL.
    
        'private_key_file'  => '', // The file path for certificate or OpenSSL private key file.
    
        'exclude_pattern'   => '#^(?!.*(config/plugin/webman/console/app.php|webman/console/src/Commands/(PharPackCommand.php|ReloadCommand.php)|LICENSE|composer.json|.github|.idea|doc|docs|.git|.setting|runtime|test|test_old|tests|Tests|vendor-bin|.md))(.*)$#',
    
        'exclude_files'     => [
            '.env', 'LICENSE', 'composer.json', 'composer.lock','start.php'
        ]
    ];
  • Tinywan 2022-02-25

    composer.json

    {
      "name": "workerman/webman",
      "type": "project",
      "keywords": [
        "high performance",
        "http service"
      ],
      "homepage": "http://www.wtbis.cn",
      "license": "MIT",
      "description": "High performance HTTP Service Framework.",
      "authors": [
        {
          "name": "walkor",
          "email": "walkor@workerman.net",
          "homepage": "http://www.wtbis.cn",
          "role": "Developer"
        }
      ],
      "support": {
        "email": "walkor@workerman.net",
        "issues": "https://github.com/walkor/webman/issues",
        "forum": "http://wenda.workerman.net/",
        "wiki": "http://workerman.net/doc/webman",
        "source": "https://github.com/walkor/webman"
      },
      "require": {
        "php": ">=7.4",
        "ext-json": "*",
        "ext-redis": "*",
        "ext-curl": "*",
        "ext-posix": "*",
        "ext-pcntl": "*",
        "workerman/webman-framework": "^1.2",
        "monolog/monolog": "^2.0",
        "ramsey/uuid": "^4.2",
        "alibabacloud/client": "^1.5",
        "aliyuncs/oss-sdk-php": "^2.4",
        "alibabacloud/sdk": "^1.8",
        "illuminate/redis": "^8.69",
        "symfony/cache": "^5.3",
        "phpoffice/phpspreadsheet": "^1.19",
        "workerman/gatewayclient": "^3.0",
        "symfony/console": "^5.4",
        "hashids/hashids": "^4.1",
        "openzipkin/zipkin": "^3.0",
        "zoujingli/ip2region": "^1.0",
        "workerman/crontab": "^1.0",
        "tinywan/webman-event": "^0.0.2",
        "tinywan/webman-validate": "^0.0.3",
        "topthink/think-orm": "^2.0",
        "webman/console": "^1.0",
        "godruoyi/php-snowflake": "^2.0",
        "smi2/phpclickhouse": "^1.4",
        "pusher/pusher-php-server": "^7.0",
        "tinywan/casbin": "^0.0.8",
        "webman/push": "^1.0",
        "tinywan/jwt": "^1.0"
      },
      "suggest": {
        "ext-event": "For better performance. "
      },
      "autoload": {
        "psr-4": {
          "" : "./"
        },
        "files": [
          "./support/helpers.php"
        ]
      },
      "require-dev": {
        "phpstan/phpstan": "^1.1",
        "friendsofphp/php-cs-fixer": "^3.2",
        "phpunit/phpunit": "^9.5",
        "kwn/php-rdkafka-stubs": "^0.0.1"
      },
      "repositories": {
        "packagist": {
          "type": "composer",
          "url": "https://mirrors.aliyun.com/composer//"
        }
      },
      "scripts": {
        "post-package-install": [
          "support\\Plugin::install"
        ],
        "pre-package-uninstall": [
          "support\\Plugin::uninstall"
        ],
        "test": "./vendor/bin/phpunit --bootstrap tests/bootstrap.php",
        "cs-fix": "./vendor/bin/php-cs-fixer fix",
        "php-stan": "./vendor/bin/phpstan analyse app"
      }
    }
    
  • yzh52521 2022-02-25
    return [
        'enable' => true,
    
        'phar_file_output_dir' => BASE_PATH . DIRECTORY_SEPARATOR . 'build',
    
        'phar_filename' => 'webman.phar',
    
        'signature_algorithm' => Phar::SHA256, //set the signature algorithm for a phar and apply it. The signature algorithm must be one of Phar::MD5, Phar::SHA1, Phar::SHA256, Phar::SHA512, or Phar::OPENSSL.
    
        'private_key_file' => '', // The file path for certificate or OpenSSL private key file.
    
        /*'exclude_pattern'   => '#^(?!.*(config/plugin/webman/console/app.php|webman/console/src/Commands/(PharPackCommand.php|ReloadCommand.php)|LICENSE|composer.json|.github|.idea|doc|docs|.git|.setting|runtime|test|test_old|tests|Tests|vendor-bin|.md))(.*)$#',
    
        'exclude_files'     => [
            '.env', 'LICENSE', 'composer.json', 'composer.lock','start.php'
        ]*/
        'exclude_pattern'  => null,
        'exclude_files'    => [],
    
    ];

    改成這樣就都可以用了

北月妖王

@Tinywan 我直接復(fù)制你的composer.json文件的依賴包,然后執(zhí)行composer update,
其他配置不變,然后打包運行,都是正常的


另外補充一點,phar文件不允許動態(tài)修改里面的內(nèi)容,如果需要上傳文件或者需要生成臨時文件,可以參考rumtime_path函數(shù),在當前目錄下生成臨時目錄。

  • yzh52521 2022-02-25

    @ fuzqing 打包后 怎么使用 命令行?

  • 北月妖王 2022-02-25

    命令行還是和webman/console包的webman一樣使用,
    因為打包后的phar文件的入口文件其實就是webman/console包的webman文件。
    mv build/webman.phar build/webman
    chmod +x build/webman
    build/webman version

  • yzh52521 2022-02-25

    @fuzqing 非常感謝! 完美了

  • Tinywan 2022-02-25

    你這明顯composer.json配置信息不全,你看我發(fā)的

  • yzh52521 2022-02-25

    @Tinywan 你把 webman/console 的配置 修改成

    'exclude_pattern'  => null,
        'exclude_files'    => [],

    就好了

  • 北月妖王 2022-02-25

    @Tinywan
    composer create-project workerman/webman mywebman
    cd mywebman && rm composer.lock -f
    // composer.json完全修改成你發(fā)的
    vim composer.json
    composer install
    php webman phar:pack
    php build/webman.phar start
    結(jié)果也是一樣可以的
    你所說的配置信息不全,是因為我忽略掉了dev環(huán)境的包,還有就是webman/console已經(jīng)包含了symfony/console,所以我就刪除了composer.json文件里面的symfony/console

  • Tinywan 2022-02-26

    感謝 @fuzqing @yzh52521 。是我本地Docker環(huán)境打包的不行,在測試環(huán)境試了一把是可以的,本地Docker打包為啥不行的問題我在找一下問題

年代過于久遠,無法發(fā)表回答
??