我不是PHP开发人员,但是我在尝试将回购信息推送到heroku时,按照提供的所有步骤尝试从服务器上获取一个laravel项目并将其移至heroku;我遇到以下错误:
Compiling common classes
remote:
remote:
remote: [ErrorException]
remote: Invalid characters passed for attempted conversion, these have been ignored
我一直在查看一个指出此错误的guthub问题-[PHP 7.4 RC3] Invalid characters passed for attempted conversion, these have been ignored #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!
我可能做错了什么。请按照以下步骤进行迁移:Deploy Laravel Projects On Heroku
编辑:也根据问题composer update
的答案中的建议尝试了printing-preview-doesnt-working-laravel-dompdf
编辑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
请记住,此升级可能包含重大更改