Could not scan for classes inside "目录" [ 2.0 版本 ]
完整报错 :[RuntimeException]
  Could not scan for classes inside "/mnt/www/hdxq/api-test/yii2-api/vendor/phpunit/php-file-iterator/src/" which
   does not appear to be a file nor a folder
linux 服务器执行 php composer.phar install ,出现以下三个报错
- Failed to execute unzip -qq '/mnt/www/hdxq/api-test/yii2-api/vendor/yiisoft/yii2-swiftmailer/3f34b1c3c654d612d6 dd4f9c2018cc2f' -d '/mnt/www/hdxq/api-test/yii2-api/vendor/composer/0656f9a3'
 
[/mnt/www/hdxq/api-test/yii2-api/vendor/yiisoft/yii2-swiftmailer/3f34b1c3c654d612d6dd4f9c2018cc2f]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /mnt/www/hdxq/api-test/yii2-api/vendor/yiisoft/yii2-swiftmailer/3f34                                                                                                                         b1c3c654d612d6dd4f9c2018cc2f or
    /mnt/www/hdxq/api-test/yii2-api/vendor/yiisoft/yii2-swiftmailer/3f34b1c3c654d612d6dd4f9c2018cc2f.zip, and ca                                                                                                                         nnot find /mnt/www/hdxq/api-test/yii2-api/vendor/yiisoft/yii2-swiftmailer/3f34b1c3c654d612d6dd4f9c2018cc2f.ZIP, peri                                                                                                                         od.
The archive may contain identical file names with different capitalization (which fails on case insensitive file                                                                                                                         systems)
Unzip with unzip command failed, falling back to ZipArchive class
- Failed to execute unzip -qq '/mnt/www/hdxq/api-test/yii2-api/vendor/yiisoft/yii2-debug/a6a54c510c50787cc85f7bdd 5d4557fc' -d '/mnt/www/hdxq/api-test/yii2-api/vendor/composer/e31c9161'
 
[/mnt/www/hdxq/api-test/yii2-api/vendor/yiisoft/yii2-debug/a6a54c510c50787cc85f7bdd5d4557fc]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /mnt/www/hdxq/api-test/yii2-api/vendor/yiisoft/yii2-debug/a6a54c510c                                                                                                                         50787cc85f7bdd5d4557fc or
    /mnt/www/hdxq/api-test/yii2-api/vendor/yiisoft/yii2-debug/a6a54c510c50787cc85f7bdd5d4557fc.zip, and cannot f                                                                                                                         ind /mnt/www/hdxq/api-test/yii2-api/vendor/yiisoft/yii2-debug/a6a54c510c50787cc85f7bdd5d4557fc.ZIP, period.
The archive may contain identical file names with different capitalization (which fails on case insensitive file                                                                                                                         systems)
Unzip with unzip command failed, falling back to ZipArchive class
3.
  [RuntimeException]
  Could not scan for classes inside "/mnt/www/hdxq/api-test/yii2-api/vendor/phpunit/php-file-iterator/src/" which
   does not appear to be a file nor a folder
本地没有任何问题, 服务器之前也没有任何问题
在技术交流群里得到解答,原因是compose的缓存内容出现问题了,在第一次install后,之后初始化操作都是从缓存读取相关内容,一旦缓存文件出问题,那么我们的的初始化就会有问题,
解决方法:
1.删除composer的缓存 ,服务器上执行 composer clear-cache (或者 php composer.phar clear-cache ),也可以删除 ~/.composer/cache 这里的文件夹,
2.删除vendor文件夹
3.重新执行初始化操作 composer install(或者 php composer.phar install)
共 0 个回答
箜篌恋风 无锡
最后登录:2020-06-15
在线时长:18小时10分
- 粉丝3
 - 金钱4655
 - 威望20
 - 积分5035