スポンサーリンク

【メモ】Laravelプロジェクトを他の環境に移行するときにハマったところ

以下コマンドの流れとなります

 

yumでphp7.1,apache,mysqlがインストールされているのが前提です

 

Laravelプロジェクトのディレクトリでcomposer updateをする

[vagrant@localhost git_my_shared]$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 67 installs, 0 updates, 0 removals
Failed to download react/promise from dist: The zip extension and unzip command are both missing, skipping.
Your command-line PHP is using multiple ini files. Run `php –ini` to show them.
Now trying to download from source
– Installing react/promise (v2.5.1): Cloning 62785ae604

[RuntimeException]
Failed to clone https://github.com/reactphp/promise.git, git was not found,
check that it is installed and in your PATH env.

sh: git: command not found

 

gitがないと言われたのでインストールする

[root@localhost ~]# yum install git
Loaded plugins: fastestmirror
base | 3.6 kB 00:00
epel/x86_64/metalink | 8.4 kB 00:00
epel | 4.7 kB 00:00
extras | 3.4 kB 00:00
mysql-connectors-community | 2.5 kB 00:00
mysql-tools-community | 2.5 kB 00:00
mysql57-community | 2.5 kB 00:00
remi-safe | 2.9 kB 00:00
updates | 3.4 kB 00:00
(1/3): epel/x86_64/updateinfo | 908 kB 00:00
(2/3): updates/7/x86_64/primary_db | 6.9 MB 00:01
(3/3): epel/x86_64/primary_db | 6.3 MB 00:03
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* epel: ftp.tsukuba.wide.ad.jp
* extras: ftp.iij.ad.jp
* remi-safe: mirrors.mediatemple.net
* updates: ftp.iij.ad.jp
Resolving Dependencies
–> Running transaction check
—> Package git.x86_64 0:1.8.3.1-12.el7_4 will be installed
–> Processing Dependency: perl-Git = 1.8.3.1-12.el7_4 for package: git-1.8.3.1-12.el7_4.x86_64
–> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-12.el7_4.x86_64
–> Processing Dependency: perl(Git) for package: git-1.8.3.1-12.el7_4.x86_64
–> Processing Dependency: perl(Error) for package: git-1.8.3.1-12.el7_4.x86_64
–> Processing Dependency: libgnome-keyring.so.0()(64bit) for package: git-1.8.3.1-12.el7_4.x86_64
–> Running transaction check
—> Package libgnome-keyring.x86_64 0:3.12.0-1.el7 will be installed
—> Package perl-Error.noarch 1:0.17020-2.el7 will be installed
—> Package perl-Git.noarch 0:1.8.3.1-12.el7_4 will be installed
—> Package perl-TermReadKey.x86_64 0:2.30-20.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
git x86_64 1.8.3.1-12.el7_4 updates 4.4 M
Installing for dependencies:
libgnome-keyring x86_64 3.12.0-1.el7 base 109 k
perl-Error noarch 1:0.17020-2.el7 base 32 k
perl-Git noarch 1.8.3.1-12.el7_4 updates 53 k
perl-TermReadKey x86_64 2.30-20.el7 base 31 k

Transaction Summary
================================================================================
Install 1 Package (+4 Dependent packages)

Total download size: 4.6 M
Installed size: 23 M
Is this ok [y/d/N]: y
Exiting on user command
Your transaction was saved, rerun it with:
yum load-transaction /tmp/yum_save_tx.2018-03-31.18-42.khrPtJ.yumtx

[root@localhost ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base epel extras mysql-connectors-community
: mysql-tools-community mysql57-community remi-safe updates
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors
[root@localhost ~]# yum install git

vagrant@localhost git_my_shared]$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 67 installs, 0 updates, 0 removals
Failed to download react/promise from dist: The zip extension and unzip command are both missing, skipping.

yum install -y zip unzip

 

ようやく最初に戻る

ルートじゃないユーザーでcomposer update実行

[vagrant@localhost git_my_shared]$ composer update

 

Generating optimized class loader
The compiled services file has been removed.

 

こんな感じのメッセージが出て終われば成功かな

 

そのあとブラウザでlaravelプロジェクトにアクセスしてみると

Whoops, looks like something went wrong.

と表示されたのでこちらの記事を参考に修正

[vagrant@localhost git_my_shared]$ cp -p .env.example .env
[vagrant@localhost git_my_shared]$ php artisan key:generate
Application key [base64:XDmcu6uMwjAlZyzx6DS5I1riR6SJAzH6DAgVGptn8r8=] set successfully.

再度ブラウザでアクセスしてみると無事表示できたので終わり

 

コメント

タイトルとURLをコピーしました