やりたいこと
AWS cloud9 でとりあえずlaravelのprojectをgitcloneしたい。
免責事項
以下の手順は2021/6/20に実施しました。環境の更新によっては手順ができない可能性があります。
##手順
- PHPのバージョン確認をします
OrganizationAccountAccessRole:~/environment $ php -v
PHP 7.2.24 (cli) (built: Oct 31 2019 18:27:08) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
PHPのversionが7.2でした。このままgithubからcloneしたのちプロジェクトを動かそうとするとphpのバージョンの影響により動作しません。ご自身で使われているPHPのバージョを合わせる作業を実施します
- php7.3をインストールしようとします
OrganizationAccountAccessRole:~/environment $ sudo amazon-linux-extras install php7.3
Refusing because php7.3 could cause an invalid combination.
- 拒否されたので確認します。
OrganizationAccountAccessRole:~/environment $ sudo amazon-linux-extras list | grep php
15 php7.2 available \
17 lamp-mariadb10.2-php7.2=latest enabled \
_ php7.3 available \
_ php7.4 available [ =stable ]
_ php8.0 available [ =stable ]
lamp-mariadb10.2-php7.2=latest enabled が有効化しておりますので競合し拒絶されています。
- 競合となるものを無効化する
OrganizationAccountAccessRole:~/environment $ sudo amazon-linux-extras disable lamp-mariadb10.2-php7.2
Beware that disabling topics is not supported after they are installed.
0 ansible2 available \
[ =2.4.2 =2.4.6 =2.8 =stable ]
2 httpd_modules available [ =1.0 =stable ]
3 memcached1.5 available \
[ =1.5.1 =1.5.16 =1.5.17 ]
5 postgresql9.6 available \
[ =9.6.6 =9.6.8 =stable ]
6 postgresql10 available [ =10 =stable ]
9 R3.4 available [ =3.4.3 =stable ]
10 rust1 available \
[ =1.22.1 =1.26.0 =1.26.1 =1.27.2 =1.31.0 =1.38.0
=stable ]
11 vim available [ =8.0 =stable ]
15 php7.2 available \
[ =7.2.0 =7.2.4 =7.2.5 =7.2.8 =7.2.11 =7.2.13 =7.2.14
=7.2.16 =7.2.17 =7.2.19 =7.2.21 =7.2.22 =7.2.23
=7.2.24 =7.2.26 =stable ]
17 lamp-mariadb10.2-php7.2 available \
[ =10.2.10_7.2.0 =10.2.10_7.2.4 =10.2.10_7.2.5
=10.2.10_7.2.8 =10.2.10_7.2.11 =10.2.10_7.2.13
=10.2.10_7.2.14 =10.2.10_7.2.16 =10.2.10_7.2.17
=10.2.10_7.2.19 =10.2.10_7.2.22 =10.2.10_7.2.23
=10.2.10_7.2.24 =stable ]
18 libreoffice available \
[ =5.0.6.2_15 =5.3.6.1 =stable ]
19 gimp available [ =2.8.22 ]
20 docker=latest enabled \
[ =17.12.1 =18.03.1 =18.06.1 =18.09.9 =stable ]
21 mate-desktop1.x available \
[ =1.19.0 =1.20.0 =stable ]
22 GraphicsMagick1.3 available \
[ =1.3.29 =1.3.32 =1.3.34 =stable ]
23 tomcat8.5 available \
[ =8.5.31 =8.5.32 =8.5.38 =8.5.40 =8.5.42 =8.5.50
=stable ]
24 epel=latest enabled [ =7.11 =stable ]
25 testing available [ =1.0 =stable ]
26 ecs available [ =stable ]
27 corretto8 available \
[ =1.8.0_192 =1.8.0_202 =1.8.0_212 =1.8.0_222 =1.8.0_232
=1.8.0_242 =stable ]
28 firecracker available [ =0.11 =stable ]
29 golang1.11 available \
[ =1.11.3 =1.11.11 =1.11.13 =stable ]
30 squid4 available [ =4 =stable ]
31 php7.3 available \
[ =7.3.2 =7.3.3 =7.3.4 =7.3.6 =7.3.8 =7.3.9 =7.3.10
=7.3.11 =7.3.13 =stable ]
32 lustre2.10 available \
[ =2.10.5 =2.10.8 =stable ]
33 java-openjdk11 available [ =11 =stable ]
34 lynis available [ =stable ]
35 kernel-ng available [ =stable ]
36 BCC available [ =0.x =stable ]
37 mono available [ =5.x =stable ]
38 nginx1 available [ =stable ]
39 ruby2.6 available [ =2.6 =stable ]
40 mock available [ =stable ]
41 postgresql11 available [ =11 =stable ]
42 php7.4 available [ =stable ]
43 livepatch available [ =stable ]
44 python3.8 available [ =stable ]
45 haproxy2 available [ =stable ]
46 collectd available [ =stable ]
47 aws-nitro-enclaves-cli available [ =stable ]
48 R4 available [ =stable ]
49 kernel-5.4 available [ =stable ]
50 selinux-ng available [ =stable ]
51 php8.0 available [ =stable ]
52 tomcat9 available [ =stable ]
53 unbound1.13 available [ =stable ]
54 mariadb10.5 available [ =stable ]
55 kernel-5.10 available [ =stable ]
56 redis6 available [ =stable ]
これで無効化できました。この時点ではphpのバージョンは変わりません。
- 次に無効化できたかどうか確認します。
OrganizationAccountAccessRole:~/environment $ sudo amazon-linux-extras list | grep php
15 php7.2 available \
17 lamp-mariadb10.2-php7.2 available \
31 php7.3 available \
42 php7.4 available [ =stable ]
51 php8.0 available [ =stable ]
- 7.3を有効化します
OrganizationAccountAccessRole:~/environment $ sudo amazon-linux-extras enable php7.3
0 ansible2 available \
[ =2.4.2 =2.4.6 =2.8 =stable ]
2 httpd_modules available [ =1.0 =stable ]
3 memcached1.5 available \
[ =1.5.1 =1.5.16 =1.5.17 ]
5 postgresql9.6 available \
[ =9.6.6 =9.6.8 =stable ]
6 postgresql10 available [ =10 =stable ]
9 R3.4 available [ =3.4.3 =stable ]
10 rust1 available \
[ =1.22.1 =1.26.0 =1.26.1 =1.27.2 =1.31.0 =1.38.0
=stable ]
11 vim available [ =8.0 =stable ]
_ php7.2 available \
[ =7.2.0 =7.2.4 =7.2.5 =7.2.8 =7.2.11 =7.2.13 =7.2.14
=7.2.16 =7.2.17 =7.2.19 =7.2.21 =7.2.22 =7.2.23
=7.2.24 =7.2.26 =stable ]
_ lamp-mariadb10.2-php7.2 available \
[ =10.2.10_7.2.0 =10.2.10_7.2.4 =10.2.10_7.2.5
=10.2.10_7.2.8 =10.2.10_7.2.11 =10.2.10_7.2.13
=10.2.10_7.2.14 =10.2.10_7.2.16 =10.2.10_7.2.17
=10.2.10_7.2.19 =10.2.10_7.2.22 =10.2.10_7.2.23
=10.2.10_7.2.24 =stable ]
18 libreoffice available \
[ =5.0.6.2_15 =5.3.6.1 =stable ]
19 gimp available [ =2.8.22 ]
20 docker=latest enabled \
[ =17.12.1 =18.03.1 =18.06.1 =18.09.9 =stable ]
21 mate-desktop1.x available \
[ =1.19.0 =1.20.0 =stable ]
22 GraphicsMagick1.3 available \
[ =1.3.29 =1.3.32 =1.3.34 =stable ]
23 tomcat8.5 available \
[ =8.5.31 =8.5.32 =8.5.38 =8.5.40 =8.5.42 =8.5.50
=stable ]
24 epel=latest enabled [ =7.11 =stable ]
25 testing available [ =1.0 =stable ]
26 ecs available [ =stable ]
27 corretto8 available \
[ =1.8.0_192 =1.8.0_202 =1.8.0_212 =1.8.0_222 =1.8.0_232
=1.8.0_242 =stable ]
28 firecracker available [ =0.11 =stable ]
29 golang1.11 available \
[ =1.11.3 =1.11.11 =1.11.13 =stable ]
30 squid4 available [ =4 =stable ]
31 php7.3=latest enabled \
[ =7.3.2 =7.3.3 =7.3.4 =7.3.6 =7.3.8 =7.3.9 =7.3.10
=7.3.11 =7.3.13 =stable ]
32 lustre2.10 available \
[ =2.10.5 =2.10.8 =stable ]
33 java-openjdk11 available [ =11 =stable ]
34 lynis available [ =stable ]
35 kernel-ng available [ =stable ]
36 BCC available [ =0.x =stable ]
37 mono available [ =5.x =stable ]
38 nginx1 available [ =stable ]
39 ruby2.6 available [ =2.6 =stable ]
40 mock available [ =stable ]
41 postgresql11 available [ =11 =stable ]
_ php7.4 available [ =stable ]
43 livepatch available [ =stable ]
44 python3.8 available [ =stable ]
45 haproxy2 available [ =stable ]
46 collectd available [ =stable ]
47 aws-nitro-enclaves-cli available [ =stable ]
48 R4 available [ =stable ]
49 kernel-5.4 available [ =stable ]
50 selinux-ng available [ =stable ]
_ php8.0 available [ =stable ]
52 tomcat9 available [ =stable ]
53 unbound1.13 available [ =stable ]
54 mariadb10.5 available [ =stable ]
55 kernel-5.10 available [ =stable ]
56 redis6 available [ =stable ]
Now you can install:
# yum clean metadata
# yum install php-cli php-pdo php-fpm php-json php-mysqlnd
無事有効化できました。念のため確認ののち、以下のコマンドを実行します。
- 確認
OrganizationAccountAccessRole:~/environment $ sudo amazon-linux-extras list | grep php
_ php7.2 available \
_ lamp-mariadb10.2-php7.2 available \
31 php7.3=latest enabled \
_ php7.4 available [ =stable ]
_ php8.0 available [ =stable ]
- 実行コマンド
Now you can install:
# yum clean metadata
# yum install php-cli php-pdo php-fpm php-json php-mysqlnd
OrganizationAccountAccessRole:~/environment $ yum clean metadata
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Cleaning repos: amzn2-core amzn2extra-docker amzn2extra-epel amzn2extra-php7.3 epel hashicorp
14 metadata files removed
0 sqlite files removed
0 metadata files removed
OrganizationAccountAccessRole:~/environment $ yum install php-cli php-pdo php-fpm php-json php-mysqlnd
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
You need to be root to perform this command.
準備完了しました。ちなみにまだversionが上がっているわけではありません
OrganizationAccountAccessRole:~/environment $ php -v
PHP 7.2.24 (cli) (built: Oct 31 2019 18:27:08) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
- ここでupdateコマンドを打ちます
OrganizationAccountAccessRole:~/environment $ sudo yum update -y
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2extra-docker | 3.0 kB 00:00:00
amzn2extra-epel | 3.0 kB 00:00:00
amzn2extra-php7.3 | 3.0 kB 00:00:00
(1/2): amzn2extra-php7.3/2/x86_64/updateinfo | 76 B 00:00:00
(2/2): amzn2extra-php7.3/2/x86_64/primary_db | 471 kB 00:00:00
235 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package php-cli.x86_64 0:7.2.24-1.amzn2.0.1 will be updated
---> Package php-cli.x86_64 0:7.3.28-1.amzn2 will be an update
---> Package php-common.x86_64 0:7.2.24-1.amzn2.0.1 will be updated
---> Package php-common.x86_64 0:7.3.28-1.amzn2 will be an update
--> Processing Dependency: libzip.so.5()(64bit) for package: php-common-7.3.28-1.amzn2.x86_64
---> Package php-devel.x86_64 0:7.2.24-1.amzn2.0.1 will be updated
---> Package php-devel.x86_64 0:7.3.28-1.amzn2 will be an update
---> Package php-fpm.x86_64 0:7.2.24-1.amzn2.0.1 will be updated
---> Package php-fpm.x86_64 0:7.3.28-1.amzn2 will be an update
---> Package php-json.x86_64 0:7.2.24-1.amzn2.0.1 will be updated
---> Package php-json.x86_64 0:7.3.28-1.amzn2 will be an update
---> Package php-mysqlnd.x86_64 0:7.2.24-1.amzn2.0.1 will be updated
---> Package php-mysqlnd.x86_64 0:7.3.28-1.amzn2 will be an update
---> Package php-pdo.x86_64 0:7.2.24-1.amzn2.0.1 will be updated
---> Package php-pdo.x86_64 0:7.3.28-1.amzn2 will be an update
---> Package php-process.x86_64 0:7.2.24-1.amzn2.0.1 will be updated
---> Package php-process.x86_64 0:7.3.28-1.amzn2 will be an update
---> Package php-xml.x86_64 0:7.2.24-1.amzn2.0.1 will be updated
---> Package php-xml.x86_64 0:7.3.28-1.amzn2 will be an update
--> Running transaction check
---> Package libzip.x86_64 0:1.3.2-1.amzn2.0.1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================================================================================
Updating:
php-cli x86_64 7.3.28-1.amzn2 amzn2extra-php7.3 4.8 M
php-common x86_64 7.3.28-1.amzn2 amzn2extra-php7.3 1.1 M
php-devel x86_64 7.3.28-1.amzn2 amzn2extra-php7.3 1.3 M
php-fpm x86_64 7.3.28-1.amzn2 amzn2extra-php7.3 1.7 M
php-json x86_64 7.3.28-1.amzn2 amzn2extra-php7.3 71 k
php-mysqlnd x86_64 7.3.28-1.amzn2 amzn2extra-php7.3 236 k
php-pdo x86_64 7.3.28-1.amzn2 amzn2extra-php7.3 132 k
php-process x86_64 7.3.28-1.amzn2 amzn2extra-php7.3 88 k
php-xml x86_64 7.3.28-1.amzn2 amzn2extra-php7.3 210 k
Installing for dependencies:
libzip x86_64 1.3.2-1.amzn2.0.1 amzn2-core 62 k
Transaction Summary
=================================================================================================================================================================================================================================
Install ( 1 Dependent package)
Upgrade 9 Packages
Total download size: 9.7 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/10): libzip-1.3.2-1.amzn2.0.1.x86_64.rpm | 62 kB 00:00:00
(2/10): php-common-7.3.28-1.amzn2.x86_64.rpm | 1.1 MB 00:00:00
(3/10): php-cli-7.3.28-1.amzn2.x86_64.rpm | 4.8 MB 00:00:00
(4/10): php-devel-7.3.28-1.amzn2.x86_64.rpm | 1.3 MB 00:00:00
(5/10): php-json-7.3.28-1.amzn2.x86_64.rpm | 71 kB 00:00:00
(6/10): php-fpm-7.3.28-1.amzn2.x86_64.rpm | 1.7 MB 00:00:00
(7/10): php-mysqlnd-7.3.28-1.amzn2.x86_64.rpm | 236 kB 00:00:00
(8/10): php-pdo-7.3.28-1.amzn2.x86_64.rpm | 132 kB 00:00:00
(9/10): php-process-7.3.28-1.amzn2.x86_64.rpm | 88 kB 00:00:00
(10/10): php-xml-7.3.28-1.amzn2.x86_64.rpm | 210 kB 00:00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 20 MB/s | 9.7 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libzip-1.3.2-1.amzn2.0.1.x86_64 1/19
Updating : php-common-7.3.28-1.amzn2.x86_64 2/19
Updating : php-json-7.3.28-1.amzn2.x86_64 3/19
Updating : php-cli-7.3.28-1.amzn2.x86_64 4/19
Updating : php-pdo-7.3.28-1.amzn2.x86_64 5/19
Updating : php-mysqlnd-7.3.28-1.amzn2.x86_64 6/19
Updating : php-devel-7.3.28-1.amzn2.x86_64 7/19
Updating : php-fpm-7.3.28-1.amzn2.x86_64 8/19
Updating : php-xml-7.3.28-1.amzn2.x86_64 9/19
Updating : php-process-7.3.28-1.amzn2.x86_64 10/19
Cleanup : php-devel-7.2.24-1.amzn2.0.1.x86_64 11/19
Cleanup : php-cli-7.2.24-1.amzn2.0.1.x86_64 12/19
Cleanup : php-mysqlnd-7.2.24-1.amzn2.0.1.x86_64 13/19
Cleanup : php-pdo-7.2.24-1.amzn2.0.1.x86_64 14/19
Cleanup : php-process-7.2.24-1.amzn2.0.1.x86_64 15/19
Cleanup : php-xml-7.2.24-1.amzn2.0.1.x86_64 16/19
Cleanup : php-fpm-7.2.24-1.amzn2.0.1.x86_64 17/19
Cleanup : php-json-7.2.24-1.amzn2.0.1.x86_64 18/19
Cleanup : php-common-7.2.24-1.amzn2.0.1.x86_64 19/19
Verifying : php-fpm-7.3.28-1.amzn2.x86_64 1/19
Verifying : php-cli-7.3.28-1.amzn2.x86_64 2/19
Verifying : php-xml-7.3.28-1.amzn2.x86_64 3/19
Verifying : php-json-7.3.28-1.amzn2.x86_64 4/19
Verifying : libzip-1.3.2-1.amzn2.0.1.x86_64 5/19
Verifying : php-process-7.3.28-1.amzn2.x86_64 6/19
Verifying : php-mysqlnd-7.3.28-1.amzn2.x86_64 7/19
Verifying : php-devel-7.3.28-1.amzn2.x86_64 8/19
Verifying : php-pdo-7.3.28-1.amzn2.x86_64 9/19
Verifying : php-common-7.3.28-1.amzn2.x86_64 10/19
Verifying : php-common-7.2.24-1.amzn2.0.1.x86_64 11/19
Verifying : php-fpm-7.2.24-1.amzn2.0.1.x86_64 12/19
Verifying : php-process-7.2.24-1.amzn2.0.1.x86_64 13/19
Verifying : php-cli-7.2.24-1.amzn2.0.1.x86_64 14/19
Verifying : php-pdo-7.2.24-1.amzn2.0.1.x86_64 15/19
Verifying : php-json-7.2.24-1.amzn2.0.1.x86_64 16/19
Verifying : php-mysqlnd-7.2.24-1.amzn2.0.1.x86_64 17/19
Verifying : php-xml-7.2.24-1.amzn2.0.1.x86_64 18/19
Verifying : php-devel-7.2.24-1.amzn2.0.1.x86_64 19/19
Dependency Installed:
libzip.x86_64 0:1.3.2-1.amzn2.0.1
Updated:
php-cli.x86_64 0:7.3.28-1.amzn2 php-common.x86_64 0:7.3.28-1.amzn2 php-devel.x86_64 0:7.3.28-1.amzn2 php-fpm.x86_64 0:7.3.28-1.amzn2 php-json.x86_64 0:7.3.28-1.amzn2 php-mysqlnd.x86_64 0:7.3.28-1.amzn2
php-pdo.x86_64 0:7.3.28-1.amzn2 php-process.x86_64 0:7.3.28-1.amzn2 php-xml.x86_64 0:7.3.28-1.amzn2
Complete!
ここまでで完了です。確認するとバージョンが上がっています
OrganizationAccountAccessRole:~/environment $ php -v
PHP 7.3.28 (cli) (built: May 13 2021 22:37:44) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.28, Copyright (c) 1998-2018 Zend Technologies
- ここから対象のURLを元にgit cloneしていきます
OrganizationAccountAccessRole:~/environment $ git clone yourURL
Cloning into 'TOTONOI'...
The authenticity of host 'github.com (52.69.186.44)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
RSA key fingerprint is MD5:16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,52.69.186.44' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
弾かれました。ここはsshの公開鍵をこの環境で作ってないので当然ですね。作っていきます。
- ssh公開鍵登録作業
OrganizationAccountAccessRole:~/environment $ cd ..
OrganizationAccountAccessRole:~ $ ls
environment node_modules package-lock.json
OrganizationAccountAccessRole:~ $ ls -a
. .aws .bash_logout .bashrc .cache environment .gitconfig .mkshrc .npm .nvm .profile .ssh .zshrc
.. .bash_history .bash_profile .c9 .config .gem .gnupg node_modules .npmrc package-lock.json .rvm .zlogin
OrganizationAccountAccessRole:~ $ cd .ssh
OrganizationAccountAccessRole:~/.ssh $ ls
authorized_keys known_hosts
OrganizationAccountAccessRole:~/.ssh $ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ec2-user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/ec2-user/.ssh/id_rsa.
Your public key has been saved in /home/ec2-user/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:uqT24L1+8UDI0Ljs4XOco0CPz29sMw1iefTJumwYMOU ec2-user@ip-172-31-9-197.ap-northeast-1.compute.internal
The key's randomart image is:
your ssh
OrganizationAccountAccessRole:~/.ssh $
OrganizationAccountAccessRole:~/.ssh $ ls
authorized_keys id_rsa id_rsa.pub known_hosts
OrganizationAccountAccessRole:~/.ssh $ cat id_rsa.pub
ssh-rsa
your ssh
あとはsshをgithubに登録してください
- 再トライ
OrganizationAccountAccessRole:~/environment $ git clone youtURL
Cloning into 'hogehoge'...
remote: Enumerating objects: 458, done.
remote: Counting objects: 100% (458/458), done.
remote: Compressing objects: 100% (258/258), done.
remote: Total 458 (delta 214), reused 410 (delta 172), pack-reused 0
Receiving objects: 100% (458/458), 833.04 KiB | 1.28 MiB/s, done.
Resolving deltas: 100% (214/214), done.
できましたので、プロジェクトの設定をしていきます。
- プロジェクトの設定をしていきます
OrganizationAccountAccessRole:~/environment $ cd/
OrganizationAccountAccessRole:~/environment/hogehoge(main) $ ls
app bootstrap composer.lock database package-lock.json public resources select storage tests
artisan composer.json config package.json phpunit.xml README.md routes server.php tailwind.config.js webpack.mix.js
OrganizationAccountAccessRole:~/environment/hoge(main) $ composer install
bash: composer: command not found
OrganizationAccountAccessRole:~/environment/hoge(main) $ curl -sS https://getcomposer.org/installer | php
All settings correct for using Composer
Downloading...
Composer (version 2.1.3) successfully installed to: /home/ec2-user/environment/TOTONOI/composer.phar
Use it: php composer.phar
OrganizationAccountAccessRole:~/environment/hoge(main) $ sudo mv composer.phar /usr/local/bin/composer
OrganizationAccountAccessRole:~/environment/hoge (main) $ composer
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 2.1.3 2021-06-09 16:31:20
Usage:
command [options] [arguments]
Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--profile Display timing and memory usage information
--no-plugins Whether to disable plugins.
-d, --working-dir=WORKING-DIR If specified, use the given directory as working directory.
--no-cache Prevent use of the cache
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Available commands:
about Shows a short information about Composer.
archive Creates an archive of this composer package.
browse Opens the package's repository URL or homepage in your browser.
cc Clears composer's internal package cache.
check-platform-reqs Check that platform requirements are satisfied.
clear-cache Clears composer's internal package cache.
clearcache Clears composer's internal package cache.
config Sets config options.
create-project Creates new project from a package into given directory.
depends Shows which packages cause the given package to be installed.
diagnose Diagnoses the system to identify common errors.
dump-autoload Dumps the autoloader.
dumpautoload Dumps the autoloader.
exec Executes a vendored binary/script.
fund Discover how to help fund the maintenance of your dependencies.
global Allows running commands in the global composer dir ($COMPOSER_HOME).
help Displays help for a command
home Opens the package's repository URL or homepage in your browser.
i Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
info Shows information about packages.
init Creates a basic composer.json file in current directory.
install Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
licenses Shows information about licenses of dependencies.
list Lists commands
outdated Shows a list of installed packages that have updates available, including their latest version.
prohibits Shows which packages prevent the given package from being installed.
reinstall Uninstalls and reinstalls the given package names
remove Removes a package from the require or require-dev.
require Adds required packages to your composer.json and installs them.
run Runs the scripts defined in composer.json.
run-script Runs the scripts defined in composer.json.
search Searches for packages.
self-update Updates composer.phar to the latest version.
selfupdate Updates composer.phar to the latest version.
show Shows information about packages.
status Shows a list of locally modified packages.
suggests Shows package suggestions.
u Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
update Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
upgrade Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
validate Validates a composer.json and composer.lock.
why Shows which packages cause the given package to be installed.
why-not Shows which packages prevent the given package from being installed.
OrganizationAccountAccessRole:~/environment/TOTONOI (master) $ sudo yum install php php-mbstring php-pdo php-gd php-xml
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core | 3.7 kB 00:00:00
235 packages excluded due to repository priority protections
Package php-pdo-7.3.28-1.amzn2.x86_64 already installed and latest version
Package php-xml-7.3.28-1.amzn2.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:7.3.28-1.amzn2 will be installed
---> Package php-gd.x86_64 0:7.3.28-1.amzn2 will be installed
--> Processing Dependency: libXpm.so.4()(64bit) for package: php-gd-7.3.28-1.amzn2.x86_64
--> Processing Dependency: libX11.so.6()(64bit) for package: php-gd-7.3.28-1.amzn2.x86_64
---> Package php-mbstring.x86_64 0:7.3.28-1.amzn2 will be installed
--> Processing Dependency: libonig.so.2()(64bit) for package: php-mbstring-7.3.28-1.amzn2.x86_64
--> Running transaction check
---> Package libX11.x86_64 0:1.6.7-3.amzn2 will be installed
--> Processing Dependency: libX11-common >= 1.6.7-3.amzn2 for package: libX11-1.6.7-3.amzn2.x86_64
--> Processing Dependency: libxcb.so.1()(64bit) for package: libX11-1.6.7-3.amzn2.x86_64
---> Package libXpm.x86_64 0:3.5.12-1.amzn2.0.2 will be installed
---> Package oniguruma.x86_64 0:5.9.6-1.amzn2.0.4 will be installed
--> Running transaction check
---> Package libX11-common.noarch 0:1.6.7-3.amzn2 will be installed
---> Package libxcb.x86_64 0:1.12-1.amzn2.0.2 will be installed
--> Processing Dependency: libXau.so.6()(64bit) for package: libxcb-1.12-1.amzn2.0.2.x86_64
--> Running transaction check
---> Package libXau.x86_64 0:1.0.8-2.1.amzn2.0.2 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================================================================================
Installing:
php x86_64 7.3.28-1.amzn2 amzn2extra-php7.3 3.2 M
php-gd x86_64 7.3.28-1.amzn2 amzn2extra-php7.3 190 k
php-mbstring x86_64 7.3.28-1.amzn2 amzn2extra-php7.3 511 k
Installing for dependencies:
libX11 x86_64 1.6.7-3.amzn2 amzn2-core 606 k
libX11-common noarch 1.6.7-3.amzn2 amzn2-core 164 k
libXau x86_64 1.0.8-2.1.amzn2.0.2 amzn2-core 29 k
libXpm x86_64 3.5.12-1.amzn2.0.2 amzn2-core 57 k
libxcb x86_64 1.12-1.amzn2.0.2 amzn2-core 216 k
oniguruma x86_64 5.9.6-1.amzn2.0.4 amzn2-core 127 k
Transaction Summary
=================================================================================================================================================================================================================================
Install 3 Packages (+6 Dependent packages)
Total download size: 5.0 M
Installed size: 17 M
Is this ok [y/d/N]: y
Downloading packages:
(1/9): libX11-common-1.6.7-3.amzn2.noarch.rpm | 164 kB 00:00:00
(2/9): libXau-1.0.8-2.1.amzn2.0.2.x86_64.rpm | 29 kB 00:00:00
(3/9): libX11-1.6.7-3.amzn2.x86_64.rpm | 606 kB 00:00:00
(4/9): libXpm-3.5.12-1.amzn2.0.2.x86_64.rpm | 57 kB 00:00:00
(5/9): libxcb-1.12-1.amzn2.0.2.x86_64.rpm | 216 kB 00:00:00
(6/9): oniguruma-5.9.6-1.amzn2.0.4.x86_64.rpm | 127 kB 00:00:00
(7/9): php-gd-7.3.28-1.amzn2.x86_64.rpm | 190 kB 00:00:00
(8/9): php-mbstring-7.3.28-1.amzn2.x86_64.rpm | 511 kB 00:00:00
(9/9): php-7.3.28-1.amzn2.x86_64.rpm | 3.2 MB 00:00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 11 MB/s | 5.0 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : oniguruma-5.9.6-1.amzn2.0.4.x86_64 1/9
Installing : libXau-1.0.8-2.1.amzn2.0.2.x86_64 2/9
Installing : libxcb-1.12-1.amzn2.0.2.x86_64 3/9
Installing : libX11-common-1.6.7-3.amzn2.noarch 4/9
Installing : libX11-1.6.7-3.amzn2.x86_64 5/9
Installing : libXpm-3.5.12-1.amzn2.0.2.x86_64 6/9
Installing : php-gd-7.3.28-1.amzn2.x86_64 7/9
Installing : php-mbstring-7.3.28-1.amzn2.x86_64 8/9
Installing : php-7.3.28-1.amzn2.x86_64 9/9
Verifying : libX11-common-1.6.7-3.amzn2.noarch 1/9
Verifying : libX11-1.6.7-3.amzn2.x86_64 2/9
Verifying : php-gd-7.3.28-1.amzn2.x86_64 3/9
Verifying : libXau-1.0.8-2.1.amzn2.0.2.x86_64 4/9
Verifying : php-7.3.28-1.amzn2.x86_64 5/9
Verifying : libXpm-3.5.12-1.amzn2.0.2.x86_64 6/9
Verifying : php-mbstring-7.3.28-1.amzn2.x86_64 7/9
Verifying : libxcb-1.12-1.amzn2.0.2.x86_64 8/9
Verifying : oniguruma-5.9.6-1.amzn2.0.4.x86_64 9/9
Installed:
php.x86_64 0:7.3.28-1.amzn2 php-gd.x86_64 0:7.3.28-1.amzn2 php-mbstring.x86_64 0:7.3.28-1.amzn2
Dependency Installed:
libX11.x86_64 0:1.6.7-3.amzn2 libX11-common.noarch 0:1.6.7-3.amzn2 libXau.x86_64 0:1.0.8-2.1.amzn2.0.2 libXpm.x86_64 0:3.5.12-1.amzn2.0.2 libxcb.x86_64 0:1.12-1.amzn2.0.2 oniguruma.x86_64 0:5.9.6-1.amzn2.0.4
Complete!
OrganizationAccountAccessRole:~/environment/TOTONOI (master) $ ls
app bootstrap composer.lock database package-lock.json public resources select storage tests
artisan composer.json config package.json phpunit.xml README.md routes server.php tailwind.config.js webpack.mix.js
OrganizationAccountAccessRole:~/environment/TOTONOI (master) $ composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 116 installs, 0 updates, 0 removals
- Downloading dasprid/enum (1.0.3)
- Downloading bacon/bacon-qr-code (2.0.3)
- Downloading doctrine/inflector (2.0.3)
- Downloading doctrine/lexer (1.2.1)
- Downloading symfony/polyfill-ctype (v1.22.1)
- Downloading webmozart/assert (1.10.0)
- Downloading dragonmantank/cron-expression (v3.1.0)
- Downloading symfony/polyfill-php80 (v1.22.1)
- Downloading symfony/polyfill-mbstring (v1.22.1)
- Downloading symfony/var-dumper (v5.2.6)
- Downloading symfony/polyfill-intl-normalizer (v1.22.1)
- Downloading symfony/polyfill-intl-grapheme (v1.22.1)
- Downloading symfony/string (v5.2.6)
- Downloading psr/container (1.1.1)
- Downloading symfony/service-contracts (v2.4.0)
- Downloading symfony/polyfill-php73 (v1.22.1)
- Downloading symfony/console (v5.2.6)
- Downloading psr/log (1.1.3)
- Downloading monolog/monolog (2.2.0)
- Downloading voku/portable-ascii (1.5.6)
- Downloading phpoption/phpoption (1.7.5)
- Downloading graham-campbell/result-type (v1.0.1)
- Downloading vlucas/phpdotenv (v5.3.0)
- Downloading symfony/css-selector (v5.2.4)
- Downloading tijsverkoyen/css-to-inline-styles (2.2.3)
- Downloading symfony/deprecation-contracts (v2.4.0)
- Downloading symfony/routing (v5.2.6)
- Downloading symfony/process (v5.2.4)
- Downloading symfony/polyfill-php72 (v1.22.1)
- Downloading symfony/polyfill-intl-idn (v1.22.1)
- Downloading symfony/mime (v5.2.6)
- Downloading symfony/http-foundation (v5.2.4)
- Downloading symfony/http-client-contracts (v2.4.0)
- Downloading psr/event-dispatcher (1.0.0)
- Downloading symfony/event-dispatcher-contracts (v2.4.0)
- Downloading symfony/event-dispatcher (v5.2.4)
- Downloading symfony/error-handler (v5.2.6)
- Downloading symfony/http-kernel (v5.2.6)
- Downloading symfony/finder (v5.2.4)
- Downloading symfony/polyfill-iconv (v1.22.1)
- Downloading egulias/email-validator (2.1.25)
- Downloading swiftmailer/swiftmailer (v6.2.7)
- Downloading ramsey/collection (1.1.3)
- Downloading brick/math (0.9.2)
- Downloading ramsey/uuid (4.1.1)
- Downloading psr/simple-cache (1.0.1)
- Downloading opis/closure (3.6.2)
- Downloading symfony/translation-contracts (v2.4.0)
- Downloading symfony/translation (v5.2.6)
- Downloading nesbot/carbon (2.46.0)
- Downloading league/mime-type-detection (1.7.0)
- Downloading league/flysystem (1.1.3)
- Downloading league/commonmark (1.5.8)
- Downloading laravel/framework (v8.40.0)
- Downloading filp/whoops (2.12.1)
- Downloading facade/ignition-contracts (1.0.2)
- Downloading facade/flare-client-php (1.7.0)
- Downloading facade/ignition (2.8.3)
- Downloading fakerphp/faker (v1.14.1)
- Downloading fideloper/proxy (4.4.1)
- Downloading asm89/stack-cors (v2.0.3)
- Downloading fruitcake/laravel-cors (v2.0.4)
- Downloading guzzlehttp/promises (1.4.1)
- Downloading ralouphie/getallheaders (3.0.3)
- Downloading psr/http-message (1.0.1)
- Downloading guzzlehttp/psr7 (1.8.2)
- Downloading jaybizzle/crawler-detect (v1.2.105)
- Downloading paragonie/constant_time_encoding (v2.4.0)
- Downloading pragmarx/google2fa (8.0.0)
- Downloading laravel/fortify (v1.7.12)
- Downloading mobiledetect/mobiledetectlib (2.8.37)
- Downloading jenssegers/agent (v2.6.4)
- Downloading laravel/jetstream (v2.3.4)
- Downloading laravel/sail (v1.5.0)
- Downloading laravel/sanctum (v2.10.0)
- Downloading psr/http-client (1.0.1)
- Downloading guzzlehttp/guzzle (7.3.0)
- Downloading league/oauth1-client (v1.9.0)
- Downloading laravel/socialite (v5.2.3)
- Downloading nikic/php-parser (v4.10.4)
- Downloading psy/psysh (v0.10.8)
- Downloading laravel/tinker (v2.6.1)
- Downloading hamcrest/hamcrest-php (v2.0.1)
- Downloading mockery/mockery (1.4.3)
- Downloading nunomaduro/collision (v5.4.0)
- Downloading phpdocumentor/reflection-common (2.2.0)
- Downloading phpdocumentor/type-resolver (1.4.0)
- Downloading phpdocumentor/reflection-docblock (5.2.2)
- Downloading sebastian/version (3.0.2)
- Downloading sebastian/type (2.3.1)
- Downloading sebastian/resource-operations (3.0.3)
- Downloading sebastian/recursion-context (4.0.4)
- Downloading sebastian/object-reflector (2.0.4)
- Downloading sebastian/object-enumerator (4.0.4)
- Downloading sebastian/global-state (5.0.2)
- Downloading sebastian/exporter (4.0.3)
- Downloading sebastian/environment (5.1.3)
- Downloading sebastian/diff (4.0.4)
- Downloading sebastian/comparator (4.0.6)
- Downloading sebastian/code-unit (1.0.8)
- Downloading sebastian/cli-parser (1.0.1)
- Downloading phpunit/php-timer (5.0.3)
- Downloading phpunit/php-text-template (2.0.4)
- Downloading phpunit/php-invoker (3.1.1)
- Downloading phpunit/php-file-iterator (3.0.5)
- Downloading theseer/tokenizer (1.2.0)
- Downloading sebastian/lines-of-code (1.0.3)
- Downloading sebastian/complexity (2.0.2)
- Downloading sebastian/code-unit-reverse-lookup (2.0.3)
- Downloading phpunit/php-code-coverage (9.2.6)
- Downloading doctrine/instantiator (1.4.0)
- Downloading phpspec/prophecy (1.13.0)
- Downloading phar-io/version (3.1.0)
- Downloading phar-io/manifest (2.0.1)
- Downloading myclabs/deep-copy (1.10.2)
- Downloading phpunit/phpunit (9.5.4)
- Installing dasprid/enum (1.0.3): Extracting archive
- Installing bacon/bacon-qr-code (2.0.3): Extracting archive
- Installing doctrine/inflector (2.0.3): Extracting archive
- Installing doctrine/lexer (1.2.1): Extracting archive
- Installing symfony/polyfill-ctype (v1.22.1): Extracting archive
- Installing webmozart/assert (1.10.0): Extracting archive
- Installing dragonmantank/cron-expression (v3.1.0): Extracting archive
- Installing symfony/polyfill-php80 (v1.22.1): Extracting archive
- Installing symfony/polyfill-mbstring (v1.22.1): Extracting archive
- Installing symfony/var-dumper (v5.2.6): Extracting archive
- Installing symfony/polyfill-intl-normalizer (v1.22.1): Extracting archive
- Installing symfony/polyfill-intl-grapheme (v1.22.1): Extracting archive
- Installing symfony/string (v5.2.6): Extracting archive
- Installing psr/container (1.1.1): Extracting archive
- Installing symfony/service-contracts (v2.4.0): Extracting archive
- Installing symfony/polyfill-php73 (v1.22.1): Extracting archive
- Installing symfony/console (v5.2.6): Extracting archive
- Installing psr/log (1.1.3): Extracting archive
- Installing monolog/monolog (2.2.0): Extracting archive
- Installing voku/portable-ascii (1.5.6): Extracting archive
- Installing phpoption/phpoption (1.7.5): Extracting archive
- Installing graham-campbell/result-type (v1.0.1): Extracting archive
- Installing vlucas/phpdotenv (v5.3.0): Extracting archive
- Installing symfony/css-selector (v5.2.4): Extracting archive
- Installing tijsverkoyen/css-to-inline-styles (2.2.3): Extracting archive
- Installing symfony/deprecation-contracts (v2.4.0): Extracting archive
- Installing symfony/routing (v5.2.6): Extracting archive
- Installing symfony/process (v5.2.4): Extracting archive
- Installing symfony/polyfill-php72 (v1.22.1): Extracting archive
- Installing symfony/polyfill-intl-idn (v1.22.1): Extracting archive
- Installing symfony/mime (v5.2.6): Extracting archive
- Installing symfony/http-foundation (v5.2.4): Extracting archive
- Installing symfony/http-client-contracts (v2.4.0): Extracting archive
- Installing psr/event-dispatcher (1.0.0): Extracting archive
- Installing symfony/event-dispatcher-contracts (v2.4.0): Extracting archive
- Installing symfony/event-dispatcher (v5.2.4): Extracting archive
- Installing symfony/error-handler (v5.2.6): Extracting archive
- Installing symfony/http-kernel (v5.2.6): Extracting archive
- Installing symfony/finder (v5.2.4): Extracting archive
- Installing symfony/polyfill-iconv (v1.22.1): Extracting archive
- Installing egulias/email-validator (2.1.25): Extracting archive
- Installing swiftmailer/swiftmailer (v6.2.7): Extracting archive
- Installing ramsey/collection (1.1.3): Extracting archive
- Installing brick/math (0.9.2): Extracting archive
- Installing ramsey/uuid (4.1.1): Extracting archive
- Installing psr/simple-cache (1.0.1): Extracting archive
- Installing opis/closure (3.6.2): Extracting archive
- Installing symfony/translation-contracts (v2.4.0): Extracting archive
- Installing symfony/translation (v5.2.6): Extracting archive
- Installing nesbot/carbon (2.46.0): Extracting archive
- Installing league/mime-type-detection (1.7.0): Extracting archive
- Installing league/flysystem (1.1.3): Extracting archive
- Installing league/commonmark (1.5.8): Extracting archive
- Installing laravel/framework (v8.40.0): Extracting archive
- Installing filp/whoops (2.12.1): Extracting archive
- Installing facade/ignition-contracts (1.0.2): Extracting archive
- Installing facade/flare-client-php (1.7.0): Extracting archive
- Installing facade/ignition (2.8.3): Extracting archive
- Installing fakerphp/faker (v1.14.1): Extracting archive
- Installing fideloper/proxy (4.4.1): Extracting archive
- Installing asm89/stack-cors (v2.0.3): Extracting archive
- Installing fruitcake/laravel-cors (v2.0.4): Extracting archive
- Installing guzzlehttp/promises (1.4.1): Extracting archive
- Installing ralouphie/getallheaders (3.0.3): Extracting archive
- Installing psr/http-message (1.0.1): Extracting archive
- Installing guzzlehttp/psr7 (1.8.2): Extracting archive
- Installing jaybizzle/crawler-detect (v1.2.105): Extracting archive
- Installing paragonie/constant_time_encoding (v2.4.0): Extracting archive
- Installing pragmarx/google2fa (8.0.0): Extracting archive
- Installing laravel/fortify (v1.7.12): Extracting archive
- Installing mobiledetect/mobiledetectlib (2.8.37): Extracting archive
- Installing jenssegers/agent (v2.6.4): Extracting archive
- Installing laravel/jetstream (v2.3.4): Extracting archive
- Installing laravel/sail (v1.5.0): Extracting archive
- Installing laravel/sanctum (v2.10.0): Extracting archive
- Installing psr/http-client (1.0.1): Extracting archive
- Installing guzzlehttp/guzzle (7.3.0): Extracting archive
- Installing league/oauth1-client (v1.9.0): Extracting archive
- Installing laravel/socialite (v5.2.3): Extracting archive
- Installing nikic/php-parser (v4.10.4): Extracting archive
- Installing psy/psysh (v0.10.8): Extracting archive
- Installing laravel/tinker (v2.6.1): Extracting archive
- Installing hamcrest/hamcrest-php (v2.0.1): Extracting archive
- Installing mockery/mockery (1.4.3): Extracting archive
- Installing nunomaduro/collision (v5.4.0): Extracting archive
- Installing phpdocumentor/reflection-common (2.2.0): Extracting archive
- Installing phpdocumentor/type-resolver (1.4.0): Extracting archive
- Installing phpdocumentor/reflection-docblock (5.2.2): Extracting archive
- Installing sebastian/version (3.0.2): Extracting archive
- Installing sebastian/type (2.3.1): Extracting archive
- Installing sebastian/resource-operations (3.0.3): Extracting archive
- Installing sebastian/recursion-context (4.0.4): Extracting archive
- Installing sebastian/object-reflector (2.0.4): Extracting archive
- Installing sebastian/object-enumerator (4.0.4): Extracting archive
- Installing sebastian/global-state (5.0.2): Extracting archive
- Installing sebastian/exporter (4.0.3): Extracting archive
- Installing sebastian/environment (5.1.3): Extracting archive
- Installing sebastian/diff (4.0.4): Extracting archive
- Installing sebastian/comparator (4.0.6): Extracting archive
- Installing sebastian/code-unit (1.0.8): Extracting archive
- Installing sebastian/cli-parser (1.0.1): Extracting archive
- Installing phpunit/php-timer (5.0.3): Extracting archive
- Installing phpunit/php-text-template (2.0.4): Extracting archive
- Installing phpunit/php-invoker (3.1.1): Extracting archive
- Installing phpunit/php-file-iterator (3.0.5): Extracting archive
- Installing theseer/tokenizer (1.2.0): Extracting archive
- Installing sebastian/lines-of-code (1.0.3): Extracting archive
- Installing sebastian/complexity (2.0.2): Extracting archive
- Installing sebastian/code-unit-reverse-lookup (2.0.3): Extracting archive
- Installing phpunit/php-code-coverage (9.2.6): Extracting archive
- Installing doctrine/instantiator (1.4.0): Extracting archive
- Installing phpspec/prophecy (1.13.0): Extracting archive
- Installing phar-io/version (3.1.0): Extracting archive
- Installing phar-io/manifest (2.0.1): Extracting archive
- Installing myclabs/deep-copy (1.10.2): Extracting archive
- Installing phpunit/phpunit (9.5.4): Extracting archive
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: facade/ignition
Discovered Package: fideloper/proxy
Discovered Package: fruitcake/laravel-cors
Discovered Package: jenssegers/agent
Discovered Package: laravel/fortify
Discovered Package: laravel/jetstream
Discovered Package: laravel/sail
Discovered Package: laravel/sanctum
Discovered Package: laravel/socialite
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
76 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
- artisan serveもためしてみます
OrganizationAccountAccessRole:~/environment/hoge(main) $ php artisan serve
Starting Laravel development server: http://127.0.0.1:8000
いけてそうです!
あとは
.env作成コマンド
php artisan key:generate
php artisan migrate
など必要に応じて打ってみてください