在生产环境(使用gitlab CI/CD部署)上的底层依赖不兼容



我尝试使用gitlab ci/cd部署我的laravel项目到linux VPS服务器,发现这些问题:

Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.
Problem 1
- phpoffice/phpspreadsheet is locked to version 1.24.1 and an update of this package was not requested.
- phpoffice/phpspreadsheet 1.24.1 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
Problem 2
- simplesoftwareio/simple-qrcode is locked to version 4.2.0 and an update of this package was not requested.
- simplesoftwareio/simple-qrcode 4.2.0 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
Problem 3
- phpoffice/phpspreadsheet 1.24.1 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
- maatwebsite/excel 3.1.40 requires phpoffice/phpspreadsheet ^1.18 -> satisfiable by phpoffice/phpspreadsheet[1.24.1].
- maatwebsite/excel is locked to version 3.1.40 and an update of this package was not requested.

这是我的。gitlab-ci文件脚本:

script:
- ssh $VAR_USER@$VAR_IP "git config --global safe.directory '*'"
- ssh $VAR_USER@$VAR_IP "if [ ! -d $VAR_DIREKTORI/.git ]; then echo 'Project belum ditemukan di direktori $VAR_DIREKTORI' && cd $VAR_DIREKTORI && git clone https://oauth2:$VAR_CLONE_KEY@$VAR_GIT_URL_TANPA_HTTP .; fi"
- ssh $VAR_USER@$VAR_IP "cd $VAR_DIREKTORI && git pull origin master && exit"
- ssh $VAR_USER@$VAR_IP "if [ -d $VAR_DIREKTORI/.env ]; then rm .env; fi"
- ssh $VAR_USER@$VAR_IP "cd $VAR_DIREKTORI && echo '$VAR_FILE_ENV' >> .env"
- ssh $VAR_USER@$VAR_IP "if [ -d $VAR_DIREKTORI/.htaccess ]; then rm .htaccess; fi"
- ssh $VAR_USER@$VAR_IP "cd $VAR_DIREKTORI && echo '$VAR_FILE_HTACCESS' >> .htaccess"
- ssh $VAR_USER@$VAR_IP "docker exec webserver composer install"
- ssh $VAR_USER@$VAR_IP "docker exec webserver composer update"
- ssh $VAR_USER@$VAR_IP "docker exec webserver php artisan migrate"
- ssh $VAR_USER@$VAR_IP "docker exec webserver php artisan db:seed"
- ssh $VAR_USER@$VAR_IP "docker exec webserver php artisan key:generate"
- echo "Done!"

据我所知,作曲家更新(我已经把脚本)将解决这个问题,但错误仍然发生,我怎么能解决它?

这个错误解释了扩展gd在PHP安装中丢失…

phpoffice/phpspreadsheet 1.24.1 ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.

在这里查看如何安装它的示例。但你可能需要谷歌一下如何为你的特定操作系统和PHP版本安装它。

https://stackoverflow.com/a/37072723/2079735

最新更新