phar打包出现问题

brookeov

问题描述

phar打包报错

程序代码

/usr/local/php_static/php8.1/php webman build:bin 8.1.15

报错信息

Phar::buildFromDirectory(): Read of 8192 bytes failed with errno=21 Is a directory

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

截图

/usr/local/php_static/php8.1/php webman build:bin 8.1.15

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

这里写具体的系统环境相关信息
Webman-framework v1.5.1
webman/console v1.2.24

append

  • config/plugin/webman/console/app.php 配置
<?php
return [
    'enable' => true,

    'build_dir'  => BASE_PATH . DIRECTORY_SEPARATOR . 'build',

    'phar_filename' => 'webman.phar',

    'bin_filename' => 'webman.bin',

    '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'   => '#^(?!.*(composer.json|/.github/|/.idea/|/.git/|/.setting/|/.idea/|/runtime/|/vendor-bin/|/build/|vendor/webman/admin))(.*)$#',

    'exclude_files'     => [
        '.env', 'LICENSE', 'composer.json', 'composer.lock', 'start.php', 'webman.phar', 'webman.bin', '.DS_Store', '.gitignore'
    ]
];
616 1 0
1个回答

walkor

发下config/plugin/webman/console/app.php 配置

  • brookeov 2023-02-24

    老大 我修改了一下

  • walkor 2023-02-24

    把配置里 exclude_pattern 注释掉试下

  • brookeov 2023-02-24

    注释也不行

  • walkor 2023-02-24

    这边没环境,不好确认什么问题。 可能和你本地环境有关,比如用了共享磁盘,具体得自己定位了

  • brookeov 2023-02-24

    老大 我这边找到原因了 我这边有public/storage 软链 删了就好了

  • brookeov 2023-02-24

    但是没有软链 storage又访问不了 老大有办法吗

  • brookeov 2023-02-24

    用修改public_path方式试下?

年代过于久远,无法发表回答
🔝