【发布时间】:2020-05-20 14:02:52
【问题描述】:
我正在尝试将 laravel 项目设置为 cpanel 上的子域,但我遇到了解析问题和错误。
这些是我到目前为止所做的步骤
- 压缩项目并上传到这个目录
public_html/encuestas - 解压并将内容移动到上面的目录
- 使用 PuTTY 和 cd 进入目录获取 ssh 访问权限
- 在 PuTTY 中执行此命令
composer install --ignore-platform-reqs
我也通过 PuTTY 完成了这一切,从 bitbucket 克隆了存储库,结果相同。
命令后我得到这个反馈
vc@un.net [~/public_html/encuestas]# composer install --ignore-platform-reqs
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
Parse error: syntax error, unexpected '?' in /home/vc/public_html/encuestas/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 500
当我转到子域 encuestas.un.ac.cr 这是我得到的错误
声明 Symfony\Component\Translation\TranslatorInterface::setLocale($locale) 必须与 Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale) 兼容
我不确定这是否相关,但我怀疑 php 版本是问题所在,在 cpanel 中我已将此域的 php 版本设置为 PHP 7.1 (ea-php71) 并且这些错误仍然存在,但是设置了 PHP 系统默认值如5.6(我不知道如何更改它)。这是我在网上找到的解析错误的解决方案,但没有奏效。
我完全不知道会发生什么或如何解决它?
编辑: 当做作曲家更新时,这是结果
vc@un.net [~/public_html/encuestas]# composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- This package requires php ^7.1.3 but your PHP version (5.6.40) does not satisfy that requirement.
Problem 2
- barryvdh/laravel-dompdf v0.8.5 requires php >=7 -> your PHP version (5.6.40) does not satisfy that requirement.
- barryvdh/laravel-dompdf 0.8.x-dev requires php >=7 -> your PHP version (5.6.40) does not satisfy that requirement.
- barryvdh/laravel-dompdf v0.8.5 requires php >=7 -> your PHP version (5.6.40) does not satisfy that requirement.
- Installation request for barryvdh/laravel-dompdf ^0.8.5 -> satisfiable by barryvdh/laravel-dompdf[0.8.x-dev, v0.8.5].
【问题讨论】: