CakePHP4 を、AWS EC2 にインストール手順をまとめた記事となります。
前提条件として、EC2サーバーのインスタンス作成までは済んでいるものとして、手順を記載しています。
AWS EC2のソフトウェア更新
AWS EC2にコマンドラインでログインし、ソフトウェアの更新を実行します。
1 2 3 4 5 |
[ec2-user@ip-xxx-xxx-xxx-xxx html]$ sudo yum update -y Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00:00 No packages marked for update [ec2-user@ip-xxx-xxx-xxx-xxx html]$ |
PHP関連のインストール
PHP7.3のインストール
今回は、Amazon Linux Extras リポジトリをインストールしてAmazon Linux 2 PHP パッケージの最新バージョンを取得し、PHP7.3をインストールします。
1 |
[ec2-user@ip-xxx-xxx-xxx-xxx html]$ sudo amazon-linux-extras install -y php7.3 |
PHP拡張モジュールのインストール
PHP本体の下記モジュール類をインストールします。
・mbstring PHP 拡張
・intl PHP 拡張
・simplexml PHP 拡張
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
[ec2-user@ip-xxx-xxx-xxx-xxx html]$ sudo yum install php php-mbstring php-intl php-xml Loaded plugins: extras_suggestions, langpacks, priorities, update-motd Resolving Dependencies --> Running transaction check ---> Package php.x86_64 0:7.2.34-1.amzn2 will be installed ---> Package php-intl.x86_64 0:7.2.34-1.amzn2 will be installed ---> Package php-mbstring.x86_64 0:7.2.34-1.amzn2 will be installed --> Processing Dependency: libonig.so.2()(64bit) for package: php-mbstring-7.2.34-1.amzn2.x86_64 ---> Package php-xml.x86_64 0:7.2.34-1.amzn2 will be installed --> Processing Dependency: libxslt.so.1(LIBXML2_1.0.24)(64bit) for package: php-xml-7.2.34-1.amzn2.x86_64 --> Processing Dependency: libxslt.so.1(LIBXML2_1.0.22)(64bit) for package: php-xml-7.2.34-1.amzn2.x86_64 --> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18)(64bit) for package: php-xml-7.2.34-1.amzn2.x86_64 --> Processing Dependency: libxslt.so.1(LIBXML2_1.0.13)(64bit) for package: php-xml-7.2.34-1.amzn2.x86_64 --> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11)(64bit) for package: php-xml-7.2.34-1.amzn2.x86_64 --> Processing Dependency: libxslt.so.1()(64bit) for package: php-xml-7.2.34-1.amzn2.x86_64 --> Processing Dependency: libexslt.so.0()(64bit) for package: php-xml-7.2.34-1.amzn2.x86_64 --> Running transaction check ---> Package libxslt.x86_64 0:1.1.28-6.amzn2 will be installed ---> Package oniguruma.x86_64 0:5.9.6-1.amzn2.0.4 will be installed --> Finished Dependency Resolution Dependencies Resolved ========================================================================================================= Package Arch Version Repository Size ========================================================================================================= Installing: php x86_64 7.2.34-1.amzn2 amzn2extra-php7.2 2.9 M php-intl x86_64 7.2.34-1.amzn2 amzn2extra-php7.2 225 k php-mbstring x86_64 7.2.34-1.amzn2 amzn2extra-php7.2 501 k php-xml x86_64 7.2.34-1.amzn2 amzn2extra-php7.2 212 k Installing for dependencies: libxslt x86_64 1.1.28-6.amzn2 amzn2-core 240 k oniguruma x86_64 5.9.6-1.amzn2.0.4 amzn2-core 127 k Transaction Summary ========================================================================================================= Install 4 Packages (+2 Dependent packages) Total download size: 4.1 M Installed size: 14 M Is this ok [y/d/N]: y Downloading packages: (1/6): oniguruma-5.9.6-1.amzn2.0.4.x86_64.rpm | 127 kB 00:00:00 (2/6): libxslt-1.1.28-6.amzn2.x86_64.rpm | 240 kB 00:00:00 (3/6): php-intl-7.2.34-1.amzn2.x86_64.rpm | 225 kB 00:00:00 (4/6): php-mbstring-7.2.34-1.amzn2.x86_64.rpm | 501 kB 00:00:00 (5/6): php-7.2.34-1.amzn2.x86_64.rpm | 2.9 MB 00:00:00 (6/6): php-xml-7.2.34-1.amzn2.x86_64.rpm | 212 kB 00:00:00 --------------------------------------------------------------------------------------------------------- Total 9.1 MB/s | 4.1 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/6 Installing : libxslt-1.1.28-6.amzn2.x86_64 2/6 Installing : php-xml-7.2.34-1.amzn2.x86_64 3/6 Installing : php-mbstring-7.2.34-1.amzn2.x86_64 4/6 Installing : php-intl-7.2.34-1.amzn2.x86_64 5/6 Installing : php-7.2.34-1.amzn2.x86_64 6/6 Verifying : libxslt-1.1.28-6.amzn2.x86_64 1/6 Verifying : php-xml-7.2.34-1.amzn2.x86_64 2/6 Verifying : php-7.2.34-1.amzn2.x86_64 3/6 Verifying : php-intl-7.2.34-1.amzn2.x86_64 4/6 Verifying : php-mbstring-7.2.34-1.amzn2.x86_64 5/6 Verifying : oniguruma-5.9.6-1.amzn2.0.4.x86_64 6/6 Installed: php.x86_64 0:7.2.34-1.amzn2 php-intl.x86_64 0:7.2.34-1.amzn2 php-mbstring.x86_64 0:7.2.34-1.amzn2 php-xml.x86_64 0:7.2.34-1.amzn2 Dependency Installed: libxslt.x86_64 0:1.1.28-6.amzn2 oniguruma.x86_64 0:5.9.6-1.amzn2.0.4 Complete! [ec2-user@ip-xxx-xxx-xxx-xxx html]$ |
Composer インストール
Composer をセットアップする手順は、次のようになります。
・セットアップ用PHPスクリプト(composer-setup.php)のダウンロード
・Composer の実行ファイル(phar)の作成
・セットアップ用PHPスクリプトの削除
1 2 3 4 5 6 7 |
[ec2-user@ip-xxx-xxx-xxx-xxx tmp]$ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" [ec2-user@ip-xxx-xxx-xxx-xxx tmp]$ ls -la total 60 drwxrwxr-x 2 ec2-user ec2-user 32 Aug 23 01:03 . drwx------ 5 ec2-user ec2-user 136 Aug 23 01:03 .. -rw-rw-r-- 1 ec2-user ec2-user 58460 Aug 23 01:03 composer-setup.php [ec2-user@ip-xxx-xxx-xxx-xxx tmp]$ |
つぎに、ダウンロードした composer-setup.php を実行して、Composer の実行ファイル(phar)を作成します。 セットアップ終了後、ls コマンドで composer.phar ができたことを確認します。
1 2 3 4 5 6 7 8 9 10 11 12 |
[ec2-user@ip-xxx-xxx-xxx-xxx tmp]$ php composer-setup.php All settings correct for using Composer Downloading... Composer (version 2.1.6) successfully installed to: /home/ec2-user/tmp/composer.phar Use it: php composer.phar [ec2-user@ip-xxx-xxx-xxx-xxx tmp]$ ls -l total 2268 -rwxr-xr-x 1 ec2-user ec2-user 2258604 Aug 23 01:05 composer.phar -rw-rw-r-- 1 ec2-user ec2-user 58460 Aug 23 01:03 composer-setup.php [ec2-user@ip-xxx-xxx-xxx-xxx tmp]$ |
composer.phar が作成できたので、セットアップスクリプト(composert-setup.php)は不要なので削除します。
1 2 3 4 5 6 7 |
[ec2-user@ip-xxx-xxx-xxx-xxx tmp]$ php -r "unlink('composer-setup.php');" [ec2-user@ip-xxx-xxx-xxx-xxx tmp]$ ls -la total 2208 drwxrwxr-x 2 ec2-user ec2-user 27 Aug 23 01:06 . drwx------ 6 ec2-user ec2-user 151 Aug 23 01:05 .. -rwxr-xr-x 1 ec2-user ec2-user 2258604 Aug 23 01:05 composer.phar [ec2-user@ip-xxx-xxx-xxx-xxx tmp]$ |
composer が利用できるようになったのかを確かめるため、作成された composer.phar を実行します。
下記の例のように、Composer のロゴとオプション一覧が出れば、動作確認完了です。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
[ec2-user@ip-xxx-xxx-xxx-xxx tmp]$ ./composer.phar -v ______ / ____/___ ____ ___ ____ ____ ________ _____ / / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/ / /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ / \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/ /_/ Composer version 2.1.6 2021-08-19 17:11:08 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. [ec2-user@ip-xxx-xxx-xxx-xxx tmp]$ |
パスの設定
Composer にパスを通します。
1 2 3 4 5 6 7 8 |
[ec2-user@ip-xxx-xxx-xxx-xxx tmp]$ sudo mv composer.phar /usr/local/bin/composer [ec2-user@ip-xxx-xxx-xxx-xxx tmp]$ ls -l total 0 [ec2-user@ip-xxx-xxx-xxx-xxx tmp]$ ls -l /usr/local/bin/ total 2208 lrwxrwxrwx 1 root root 37 Aug 20 05:56 aws -> /usr/local/aws-cli/v2/current/bin/aws lrwxrwxrwx 1 root root 47 Aug 20 05:56 aws_completer -> /usr/local/aws-cli/v2/current/bin/aws_completer -rwxr-xr-x 1 ec2-user ec2-user 2258604 Aug 23 01:05 composer |
CakePHP4インストール
インストール先:/var/www/html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
[ec2-user@ip-xxx-xxx-xxx-xxx html]$ composer create-project --prefer-dist cakephp/app:4.* app Creating a "cakephp/app:4.*" project at "./app" Installing cakephp/app (4.2.2) - Downloading cakephp/app (4.2.2) - Installing cakephp/app (4.2.2): Extracting archive Created project in /var/www/html/app Loading composer repositories with package information Updating dependencies Lock file operations: 89 installs, 0 updates, 0 removals - Locking brick/varexporter (0.3.5) - Locking cakephp/bake (2.5.2) - Locking cakephp/cakephp (4.2.8) - Locking cakephp/cakephp-codesniffer (4.2.4) - Locking cakephp/chronos (2.2.0) - Locking cakephp/debug_kit (4.4.3) - Locking cakephp/migrations (3.1.0) - Locking cakephp/plugin-installer (1.3.1) - Locking cakephp/twig-view (1.2.0) - Locking composer/ca-bundle (1.2.10) - Locking composer/composer (2.1.6) - Locking composer/metadata-minifier (1.0.0) - Locking composer/semver (3.2.5) - Locking composer/spdx-licenses (1.5.5) - Locking composer/xdebug-handler (2.0.2) - Locking dealerdirect/phpcodesniffer-composer-installer (v0.7.1) - Locking doctrine/instantiator (1.4.0) - Locking jasny/twig-extensions (v1.3.0) - Locking jdorn/sql-formatter (v1.2.17) - Locking josegonzalez/dotenv (3.2.0) - Locking justinrainbow/json-schema (5.2.11) - Locking laminas/laminas-diactoros (2.4.1) - Locking laminas/laminas-httphandlerrunner (1.2.0) - Locking laminas/laminas-zendframework-bridge (1.1.1) - Locking league/container (3.4.1) - Locking m1/env (2.2.0) - Locking mobiledetect/mobiledetectlib (2.8.37) - Locking myclabs/deep-copy (1.10.2) - Locking nikic/php-parser (v4.12.0) - Locking phar-io/manifest (2.0.3) - Locking phar-io/version (3.1.0) - Locking phpdocumentor/reflection-common (2.2.0) - Locking phpdocumentor/reflection-docblock (5.2.2) - Locking phpdocumentor/type-resolver (1.4.0) - Locking phpspec/prophecy (1.13.0) - Locking phpstan/phpdoc-parser (0.4.9) - Locking phpunit/php-code-coverage (7.0.15) - Locking phpunit/php-file-iterator (2.0.4) - Locking phpunit/php-text-template (1.2.1) - Locking phpunit/php-timer (2.1.3) - Locking phpunit/php-token-stream (3.1.3) - Locking phpunit/phpunit (8.5.19) - Locking psr/container (1.1.1) - Locking psr/http-client (1.0.1) - Locking psr/http-factory (1.0.1) - Locking psr/http-message (1.0.1) - Locking psr/http-server-handler (1.0.1) - Locking psr/http-server-middleware (1.0.1) - Locking psr/log (1.1.4) - Locking psr/simple-cache (1.0.1) - Locking psy/psysh (v0.10.8) - Locking react/promise (v2.8.0) - Locking robmorgan/phinx (0.12.7) - Locking sebastian/code-unit-reverse-lookup (1.0.2) - Locking sebastian/comparator (3.0.3) - Locking sebastian/diff (3.0.3) - Locking sebastian/environment (4.2.4) - Locking sebastian/exporter (3.1.3) - Locking sebastian/global-state (3.0.1) - Locking sebastian/object-enumerator (3.0.4) - Locking sebastian/object-reflector (1.1.2) - Locking sebastian/recursion-context (3.0.1) - Locking sebastian/resource-operations (2.0.2) - Locking sebastian/type (1.1.4) - Locking sebastian/version (2.0.1) - Locking seld/jsonlint (1.8.3) - Locking seld/phar-utils (1.1.2) - Locking slevomat/coding-standard (6.4.1) - Locking squizlabs/php_codesniffer (3.5.8) - Locking symfony/config (v5.3.4) - Locking symfony/console (v5.3.6) - Locking symfony/deprecation-contracts (v2.4.0) - Locking symfony/filesystem (v5.3.4) - Locking symfony/finder (v5.3.4) - Locking symfony/polyfill-ctype (v1.23.0) - Locking symfony/polyfill-intl-grapheme (v1.23.1) - Locking symfony/polyfill-intl-normalizer (v1.23.0) - Locking symfony/polyfill-mbstring (v1.23.1) - Locking symfony/polyfill-php73 (v1.23.0) - Locking symfony/polyfill-php80 (v1.23.1) - Locking symfony/polyfill-php81 (v1.23.0) - Locking symfony/process (v5.3.4) - Locking symfony/service-contracts (v2.4.0) - Locking symfony/string (v5.3.3) - Locking symfony/var-dumper (v5.3.6) - Locking theseer/tokenizer (1.2.1) - Locking twig/markdown-extra (v3.3.1) - Locking twig/twig (v3.3.2) - Locking webmozart/assert (1.10.0) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 89 installs, 0 updates, 0 removals - Downloading cakephp/plugin-installer (1.3.1) - Downloading squizlabs/php_codesniffer (3.5.8) - Downloading dealerdirect/phpcodesniffer-composer-installer (v0.7.1) - Downloading symfony/polyfill-mbstring (v1.23.1) - Downloading symfony/polyfill-ctype (v1.23.0) - Downloading twig/twig (v3.3.2) - Downloading twig/markdown-extra (v3.3.1) - Downloading jasny/twig-extensions (v1.3.0) - Downloading psr/simple-cache (1.0.1) - Downloading psr/log (1.1.4) - Downloading psr/http-message (1.0.1) - Downloading psr/http-server-handler (1.0.1) - Downloading psr/http-server-middleware (1.0.1) - Downloading psr/http-client (1.0.1) - Downloading psr/container (1.1.1) - Downloading league/container (3.4.1) - Downloading psr/http-factory (1.0.1) - Downloading laminas/laminas-zendframework-bridge (1.1.1) - Downloading laminas/laminas-diactoros (2.4.1) - Downloading laminas/laminas-httphandlerrunner (1.2.0) - Downloading composer/ca-bundle (1.2.10) - Downloading cakephp/chronos (2.2.0) - Downloading cakephp/cakephp (4.2.8) - Downloading cakephp/twig-view (1.2.0) - Downloading nikic/php-parser (v4.12.0) - Downloading brick/varexporter (0.3.5) - Downloading cakephp/bake (2.5.2) - Downloading phpstan/phpdoc-parser (0.4.9) - Downloading slevomat/coding-standard (6.4.1) - Downloading cakephp/cakephp-codesniffer (4.2.4) - Downloading jdorn/sql-formatter (v1.2.17) - Downloading symfony/polyfill-php80 (v1.23.1) - Downloading symfony/process (v5.3.4) - Downloading symfony/finder (v5.3.4) - Downloading symfony/filesystem (v5.3.4) - Downloading symfony/polyfill-intl-normalizer (v1.23.0) - Downloading symfony/polyfill-intl-grapheme (v1.23.1) - Downloading symfony/string (v5.3.3) - Downloading symfony/service-contracts (v2.4.0) - Downloading symfony/polyfill-php73 (v1.23.0) - Downloading symfony/deprecation-contracts (v2.4.0) - Downloading symfony/console (v5.3.6) - Downloading seld/phar-utils (1.1.2) - Downloading seld/jsonlint (1.8.3) - Downloading react/promise (v2.8.0) - Downloading justinrainbow/json-schema (5.2.11) - Downloading composer/xdebug-handler (2.0.2) - Downloading composer/spdx-licenses (1.5.5) - Downloading composer/semver (3.2.5) - Downloading composer/metadata-minifier (1.0.0) - Downloading composer/composer (2.1.6) - Downloading cakephp/debug_kit (4.4.3) - Downloading symfony/polyfill-php81 (v1.23.0) - Downloading symfony/config (v5.3.4) - Downloading robmorgan/phinx (0.12.7) - Downloading cakephp/migrations (3.1.0) - Downloading m1/env (2.2.0) - Downloading josegonzalez/dotenv (3.2.0) - Downloading mobiledetect/mobiledetectlib (2.8.37) - Downloading webmozart/assert (1.10.0) - Downloading phpdocumentor/reflection-common (2.2.0) - Downloading phpdocumentor/type-resolver (1.4.0) - Downloading phpdocumentor/reflection-docblock (5.2.2) - Downloading phpunit/php-token-stream (3.1.3) - Downloading sebastian/version (2.0.1) - Downloading sebastian/type (1.1.4) - Downloading sebastian/resource-operations (2.0.2) - Downloading sebastian/recursion-context (3.0.1) - Downloading sebastian/object-reflector (1.1.2) - Downloading sebastian/object-enumerator (3.0.4) - Downloading sebastian/global-state (3.0.1) - Downloading sebastian/exporter (3.1.3) - Downloading sebastian/environment (4.2.4) - Downloading sebastian/diff (3.0.3) - Downloading sebastian/comparator (3.0.3) - Downloading phpunit/php-timer (2.1.3) - Downloading phpunit/php-text-template (1.2.1) - Downloading phpunit/php-file-iterator (2.0.4) - Downloading theseer/tokenizer (1.2.1) - Downloading sebastian/code-unit-reverse-lookup (1.0.2) - Downloading phpunit/php-code-coverage (7.0.15) - 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.3) - Downloading myclabs/deep-copy (1.10.2) - Downloading phpunit/phpunit (8.5.19) - Downloading symfony/var-dumper (v5.3.6) - Downloading psy/psysh (v0.10.8) - Installing cakephp/plugin-installer (1.3.1): Extracting archive - Installing squizlabs/php_codesniffer (3.5.8): Extracting archive - Installing dealerdirect/phpcodesniffer-composer-installer (v0.7.1): Extracting archive - Installing symfony/polyfill-mbstring (v1.23.1): Extracting archive - Installing symfony/polyfill-ctype (v1.23.0): Extracting archive - Installing twig/twig (v3.3.2): Extracting archive - Installing twig/markdown-extra (v3.3.1): Extracting archive - Installing jasny/twig-extensions (v1.3.0): Extracting archive - Installing psr/simple-cache (1.0.1): Extracting archive - Installing psr/log (1.1.4): Extracting archive - Installing psr/http-message (1.0.1): Extracting archive - Installing psr/http-server-handler (1.0.1): Extracting archive - Installing psr/http-server-middleware (1.0.1): Extracting archive - Installing psr/http-client (1.0.1): Extracting archive - Installing psr/container (1.1.1): Extracting archive - Installing league/container (3.4.1): Extracting archive - Installing psr/http-factory (1.0.1): Extracting archive - Installing laminas/laminas-zendframework-bridge (1.1.1): Extracting archive - Installing laminas/laminas-diactoros (2.4.1): Extracting archive - Installing laminas/laminas-httphandlerrunner (1.2.0): Extracting archive - Installing composer/ca-bundle (1.2.10): Extracting archive - Installing cakephp/chronos (2.2.0): Extracting archive - Installing cakephp/cakephp (4.2.8): Extracting archive - Installing cakephp/twig-view (1.2.0): Extracting archive - Installing nikic/php-parser (v4.12.0): Extracting archive - Installing brick/varexporter (0.3.5): Extracting archive - Installing cakephp/bake (2.5.2): Extracting archive - Installing phpstan/phpdoc-parser (0.4.9): Extracting archive - Installing slevomat/coding-standard (6.4.1): Extracting archive - Installing cakephp/cakephp-codesniffer (4.2.4): Extracting archive - Installing jdorn/sql-formatter (v1.2.17): Extracting archive - Installing symfony/polyfill-php80 (v1.23.1): Extracting archive - Installing symfony/process (v5.3.4): Extracting archive - Installing symfony/finder (v5.3.4): Extracting archive - Installing symfony/filesystem (v5.3.4): Extracting archive - Installing symfony/polyfill-intl-normalizer (v1.23.0): Extracting archive - Installing symfony/polyfill-intl-grapheme (v1.23.1): Extracting archive - Installing symfony/string (v5.3.3): Extracting archive - Installing symfony/service-contracts (v2.4.0): Extracting archive - Installing symfony/polyfill-php73 (v1.23.0): Extracting archive - Installing symfony/deprecation-contracts (v2.4.0): Extracting archive - Installing symfony/console (v5.3.6): Extracting archive - Installing seld/phar-utils (1.1.2): Extracting archive - Installing seld/jsonlint (1.8.3): Extracting archive - Installing react/promise (v2.8.0): Extracting archive - Installing justinrainbow/json-schema (5.2.11): Extracting archive - Installing composer/xdebug-handler (2.0.2): Extracting archive - Installing composer/spdx-licenses (1.5.5): Extracting archive - Installing composer/semver (3.2.5): Extracting archive - Installing composer/metadata-minifier (1.0.0): Extracting archive - Installing composer/composer (2.1.6): Extracting archive - Installing cakephp/debug_kit (4.4.3): Extracting archive - Installing symfony/polyfill-php81 (v1.23.0): Extracting archive - Installing symfony/config (v5.3.4): Extracting archive - Installing robmorgan/phinx (0.12.7): Extracting archive - Installing cakephp/migrations (3.1.0): Extracting archive - Installing m1/env (2.2.0): Extracting archive - Installing josegonzalez/dotenv (3.2.0): Extracting archive - Installing mobiledetect/mobiledetectlib (2.8.37): Extracting archive - Installing webmozart/assert (1.10.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 phpunit/php-token-stream (3.1.3): Extracting archive - Installing sebastian/version (2.0.1): Extracting archive - Installing sebastian/type (1.1.4): Extracting archive - Installing sebastian/resource-operations (2.0.2): Extracting archive - Installing sebastian/recursion-context (3.0.1): Extracting archive - Installing sebastian/object-reflector (1.1.2): Extracting archive - Installing sebastian/object-enumerator (3.0.4): Extracting archive - Installing sebastian/global-state (3.0.1): Extracting archive - Installing sebastian/exporter (3.1.3): Extracting archive - Installing sebastian/environment (4.2.4): Extracting archive - Installing sebastian/diff (3.0.3): Extracting archive - Installing sebastian/comparator (3.0.3): Extracting archive - Installing phpunit/php-timer (2.1.3): Extracting archive - Installing phpunit/php-text-template (1.2.1): Extracting archive - Installing phpunit/php-file-iterator (2.0.4): Extracting archive - Installing theseer/tokenizer (1.2.1): Extracting archive - Installing sebastian/code-unit-reverse-lookup (1.0.2): Extracting archive - Installing phpunit/php-code-coverage (7.0.15): 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.3): Extracting archive - Installing myclabs/deep-copy (1.10.2): Extracting archive - Installing phpunit/phpunit (8.5.19): Extracting archive - Installing symfony/var-dumper (v5.3.6): Extracting archive - Installing psy/psysh (v0.10.8): Extracting archive 24 package suggestions were added by new dependencies, use `composer suggest` to see details. Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested. Generating autoload files 50 packages you are using are looking for funding. Use the `composer fund` command to find out more! PHP CodeSniffer Config installed_paths set to ../../cakephp/cakephp-codesniffer,../../slevomat/coding-standard > App\Console\Installer::postInstall Created `config/app_local.php` file Created `/var/www/html/app/logs` directory Created `/var/www/html/app/tmp/cache/views` directory Set Folder Permissions ? (Default to Y) [Y,n]? Y Permissions set on /var/www/html/app/tmp/cache Permissions set on /var/www/html/app/tmp/cache/models Permissions set on /var/www/html/app/tmp/cache/persistent Permissions set on /var/www/html/app/tmp/cache/views Permissions set on /var/www/html/app/tmp/sessions Permissions set on /var/www/html/app/tmp/tests Permissions set on /var/www/html/app/tmp Permissions set on /var/www/html/app/logs Updated Security.salt value in config/app_local.php [ec2-user@ip-xxx-xxx-xxx-xxx html]$ |
Apache設定
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # #DocumentRoot "/var/www/html" DocumentRoot "/var/www/html/app/webroot" .htaccessを使うため、下記に変更 AllowOverride None ↓ AllowOverride All # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # #AllowOverride None AllowOverride All |
Apache の再起動
下記のコマンドを実行し、Apache を再起動します。
1 |
$ ssh ec2-user@xxx.xxx.xxx.xxx log]$ sudo systemctl restart httpd |
動作確認
EC2のパブリックURLを入力し、下記の画面が表示されればインストール完了となります。