LoginSignup
0
0

More than 3 years have passed since last update.

EC2 (AmazonLinux2) の立ち上げ、PHP7.4, composerのインストール, vimの整備

Posted at

EC2インスタンス作成

AMIをAmazonLinux2にしてインスタンス作成
AWSコンソールでGUI的な操作でぽちぽち

yum update

sudo yum update

PHP7.4, composerのインストール

remiを入れる

sudo amazon-linux-extras install epel
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

install PHP7.4, composer

sudo yum install php74 php74-php composer php74-php-simplexml php74-php-mbstring
# ついでに必要そうないくつかのPHP拡張も同時にインストール

デフォルトのPHPをインストールしたPHP74で置き換え

sudo mv /usr/bin/php /tmp/php54
sudo ln -s /usr/bin/php74 /usr/bin/php

スワップ領域作成 (composer require が成功するために)

# サイズはcountの値で調整する
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo chmod 600 /var/swap.1
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1

vimの設定

(インストール自体は最初からされている)

install Git

sudo yum install git

NeoBundle入れる

git clone git://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim

NeoBundle向けに、~/.vimrcに追記する

"NeoBundle Scripts-----------------------------
if &compatible
  set nocompatible               " Be iMproved
endif

" Required:
set runtimepath^=~/.vim/bundle/neobundle.vim/

" Required:
call neobundle#begin(expand('~/.vim/bundle'))

" Let NeoBundle manage NeoBundle
" Required:
NeoBundleFetch 'Shougo/neobundle.vim'

" Add or remove your Bundles here:
NeoBundle 'Shougo/neosnippet.vim'
NeoBundle 'Shougo/neosnippet-snippets'
NeoBundle 'tpope/vim-fugitive'
NeoBundle 'ctrlpvim/ctrlp.vim'
NeoBundle 'flazz/vim-colorschemes'

" You can specify revision/branch/tag.
NeoBundle 'Shougo/vimshell', { 'rev' : '3787e5' }
NeoBundle 'editorconfig/editorconfig-vim'

" Required:
call neobundle#end()

" Required:
filetype plugin indent on

" If there are uninstalled bundles found on startup,
" this will conveniently prompt you to install them.
NeoBundleCheck

"End NeoBundle Scripts-------------------------

~/.editorconfig

適当に設定

[*.php]
indent_style   = space
indent_size    = 4

あとがき

最初からPHPがインストールされてる、良い感じのAMIから始めれば良かった

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0