我嘗試使用 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!"
據我所知,作曲家更新(我已經放在腳本中)將解決這個問題,但錯誤仍然發生,我該如何解決?
uj5u.com熱心網友回復:
該錯誤說明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
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/537379.html
上一篇:LaravelEloquentwithcount與其他模型屬性相比
下一篇:如何在laravel中設定例外
