php - 为尝试转换传递的无效字符,这些已被忽略 - 将 Laravel 项目推送到 heroku
问题描述
我正在尝试从服务器获取一个 laravel 项目并按照所有提供的步骤将其移动到 heroku,当将 repo 推送到 heroku 时,我遇到以下错误:
Compiling common classes
remote:
remote:
remote: [ErrorException]
remote: Invalid characters passed for attempted conversion, these have been ignored
我一直在查看一个说明此错误的 Guthub 问题 - [PHP 7.4 RC3] 为尝试转换传递的无效字符,这些已被忽略 #2003 - 这是我能找到的少数答案之一。但是,我的项目(vendor/dompdf/dompdf/lib/Cpdf.php)中不存在此问题引用的文件。
error_reporting(E_ALL ^ E_DEPRECATED);
其中一个答案建议通过添加到引发错误的文件来关闭错误报告。知道把那条线放在哪里吗?
我看不到错误被抛出的文件。见消息:
Script php artisan optimize handling the post-install-cmd event returned with error code 1
remote: ! WARNING: A post-install-cmd script terminated with an error
remote:
remote: ! ERROR: Dependency installation failed!
我可能正在做一些明显错误的事情。按照以下步骤进行迁移:在 Heroku 上部署 Laravel 项目
编辑:也按照这个问题printing-preview-doesnt-working-laravel-dompdfcomposer update
的回答中的建议进行了尝试
编辑2:下面是构建日志:
Package mtdowling/cron-expression is abandoned, you should avoid using it. Use dragonmantank/cron-expression instead.
remote: Generating optimized autoload files
remote: Carbon 1 is deprecated, see how to migrate to Carbon 2.
remote: https://carbon.nesbot.com/docs/#api-carbon-2
remote: You can run './vendor/bin/upgrade-carbon' to get help in updating carbon and other frameworks and libraries that depend on it.
remote: 1 package you are using is looking for funding.
remote: Use the `composer fund` command to find out more!
remote: > Illuminate\Foundation\ComposerScripts::postInstall
remote: > php artisan optimize
remote: Generating optimized class loader
remote: Compiling common classes
remote:
remote:
remote: [ErrorException]
remote: Invalid characters passed for attempted conversion, these have been ignored
remote:
remote:
remote: Script php artisan optimize handling the post-install-cmd event returned with error code 1
remote: ! WARNING: A post-install-cmd script terminated with an error
remote:
remote: ! ERROR: Dependency installation failed!
remote: !
remote: ! The 'composer install' process failed with an error. The cause
remote: ! may be the download or installation of packages, or a pre- or
remote: ! post-install hook (e.g. a 'post-install-cmd' item in 'scripts')
remote: ! in your 'composer.json'.
remote: !
remote: ! Typical error cases are out-of-date or missing parts of code,
remote: ! timeouts when making external connections, or memory limits.
remote: !
remote: ! Check the above error output closely to determine the cause of
remote: ! the problem, ensure the code you're pushing is functioning
remote: ! properly, and that all local changes are committed correctly.
remote: !
remote: ! For more information on builds for PHP on Heroku, refer to
remote: ! https://devcenter.heroku.com/articles/php-support
remote: !
remote: ! REMINDER: the following warnings were emitted during the build;
remote: ! check the details above, as they may be related to this error:
remote: ! - A post-install-cmd script terminated with an error
我试过更新mtdowling/cron-expression
包 - 但它一直在恢复它。这或 Carbon 错误是否会导致“无效字符错误”?
解决方案
升级dompdf/dompdf
到版本0.8.5
将解决这个问题:https ://github.com/dompdf/dompdf/releases
可以通过以下方式安装最新版本:
composer require dompdf/dompdf
或composer.json
手动修改0.8.5
并运行:
composer install
请记住,此升级可能包含重大更改
推荐阅读
- model - Committee Methods (ensemble learners) Best Model
- kubernetes - Magento CLI 设置,指定的实体类型无效:catalog_category
- javascript - JS Promise - 返回一些结果而不解决承诺
- css - 类名倒序
- ios - dyld:未加载库:@rpath/GoogleInteractiveMediaAds.framework/GoogleInteractiveMediaAds 自定义框架集成中的错误
- linux - 如何使用 Bash 收缩/收缩一组值
- python - 如何将 django 1.11 移植到 django 2.2 和 python 2.7 到 3.5?
- powerbi - 总和基于值是否在不同的表中可用
- amazon-web-services - 如何使用氡的 JSON 结果在 Athena 中创建表
- linux-kernel - Linux设备树:如何解析包含单元列表的属性