PHP - CakePHP - インストール - FreeBSD 12.2 RELEASE - 初期設定

 クラウディア
1. 概要
2. Composer
3. プロジェクト作成

1. 概要

 当初、「4.x」をインストールしようとしていたのですが、なんだか、インストール時に

composer: 照合パターンに合いません.
 てな、メッセージが出まして・・・。  どうも、わたしの環境では、「4.x」は、インストールできないらしい。  ちゅうことで、「インストール - 3.9」を参考にインストールしてみます。  上記、「CakePHP 3.9」のページなのですが、表記が、「3.8」やら「3.6」やら混じっているようなのでご注意。  なんだか、わかっていないのですが、「XAMPP」ってやつ?  下記の環境へインストールしてみます。
 項目   バージョン等   備考 
プラットフォーム FreeBSD 12.2 RELEASE
PHP php72-7.2.34
データベース postgresql96-server-9.6.19

 オペレーティングシステムは、現時点(2020年12月24日)で最新のものです。

 「PHP」の「mbstring」「intl」「simplexml」は、既にインストール済ですが、「intl」は、無効化しなきゃならんのかな。

2. Composer

 「Composer」が必要らしいのでインストールします。  「Composer」に関しては、「PHP - composer(パッケージ管理)」の手順で・・・。

cd /usr/ports/www/mod_php72
make
make install
 インストール時のメッセージを掲載しておきます。  これで、バージョンもわかりますので。

===>  Installing for php72-composer-1.10.15
===>  Checking if php72-composer is already installed
===>   Registering installation for php72-composer-1.10.15
Installing php72-composer-1.10.15...
 参考サイトでは、インストール後、「composer.phar」を「/usr/local/bin/composer」として置け、と書いちょるが。  「ports」では、インストール後

$ ls -l /usr/local/bin/composer
lrwxr-xr-x 1 root wheel 13 12月 24 13:04 /usr/local/bin/composer -> composer.phar
 ちゅうことになっちょるので、よしとする。

3. プロジェクト作成

 試行錯誤の際、「root」ユーザでプロジェクトを作成しようとしたら、「『root』ユーザは、だめよん」みたいなメッセージが出ました。  強行することもできるようですが、まぁ、やめておきます。  なので、ログインユーザで誰かひとり、プロジェクトのオーナーとします。  作業ディレクトリの配下にプロジェクトを作成しますので、作業ディレクトリ自身が、プロジェクトオーナーのものでなければなりません。  ログインユーザ(プロジェクトオーナー)で

$ cd /作業ディレクトリのパス/
$ php /usr/local/bin/composer.phar create-project --prefer-dist cakephp/app:^3.8 cake
Creating a "cakephp/app:^3.8" project at "./cake"
Installing cakephp/app (3.9.0)
  - Installing cakephp/app (3.9.0): Downloading (100%)
Created project in /プロジェクトのパス/cake
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 83 installs, 0 updates, 0 removals
  - Installing cakephp/plugin-installer (1.3.1): Downloading (100%)
  - Installing aura/intl (3.0.0): Downloading (100%)
  - Installing paragonie/random_compat (v9.99.99): Downloading (100%)

・・・	略	・・・

  - Installing nikic/php-parser (v4.10.4): Downloading (100%)
  - Installing symfony/var-dumper (v5.2.1): Downloading (100%)
  - Installing psy/psysh (v0.10.5): Downloading (100%)
cakephp/app suggests installing markstory/asset_compress (An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.)
cakephp/app suggests installing dereuromark/cakephp-ide-helper (After baking your code, this keeps your annotations in sync with the code evolving from there on for maximum IDE and PHPStan/Psalm compatibility.)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
cakephp/cakephp suggests installing lib-ICU (The intl PHP library, to use Text::transliterate() or Text::slug())
cakephp/cakephp suggests installing paragonie/csp-builder (CSP builder, to use the CSP Middleware)
symfony/service-contracts suggests installing symfony/service-implementation
symfony/console suggests installing symfony/event-dispatcher
symfony/console suggests installing symfony/lock
asm89/twig-cache-extension suggests installing psr/cache-implementation (To make use of PSR-6 cache implementation via PsrCacheAdapter.)
aptoma/twig-markdown suggests installing michelf/php-markdown (Original Markdown engine with MarkdownExtra.)
aptoma/twig-markdown suggests installing knplabs/github-api (Needed for using GitHub's Markdown engine provided through their API.)
ajgl/breakpoint-twig-extension suggests installing ext-xdebug (The Xdebug extension is required for the breakpoint to work)
ajgl/breakpoint-twig-extension suggests installing symfony/framework-bundle (The framework bundle to integrate the extension into Symfony)
ajgl/breakpoint-twig-extension suggests installing symfony/twig-bundle (The twig bundle to integrate the extension into Symfony)
composer/composer suggests installing ext-zip (Enabling the zip extension allows you to unzip archives)
m1/env suggests installing m1/vars (For loading of configs)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit-mock-objects suggests installing ext-soap (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.5.5)
phpunit/phpunit suggests installing phpunit/php-invoker (^1.1)
phpunit/phpunit suggests installing ext-xdebug (*)
psy/psysh suggests installing ext-pcntl (Enabling the PCNTL extension makes PsySH a lot happier :))
psy/psysh suggests installing ext-readline (Enables support for arrow-key history navigation, and showing and manipulating command history.)
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)
Package asm89/twig-cache-extension is abandoned, you should avoid using it. Use twig/cache-extension instead.
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
> Cake\Composer\Installer\PluginInstaller::postAutoloadDump



     Action required!

     The CakePHP plugin installer v1.3+ no longer requires the
     "post-autoload-dump" hook. Please update your app's composer.json
     file and remove usage of
     Cake\Composer\Installer\PluginInstaller::postAutoloadDump



32 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> App\Console\Installer::postInstall
Created `config/app_local.php` file
Created `/プロジェクトのパス/cake/tmp/cache/views` directory
Set Folder Permissions ? (Default to Y) [Y,n]?
 ここで Enter

Permissions set on /プロジェクトのパス/cake/tmp/cache
Permissions set on /プロジェクトのパス/cake/tmp/cache/models
Permissions set on /プロジェクトのパス/cake/tmp/cache/persistent
Permissions set on /プロジェクトのパス/cake/tmp/cache/views
Permissions set on /プロジェクトのパス/cake/tmp/sessions
Permissions set on /プロジェクトのパス/cake/tmp/tests
Permissions set on /プロジェクトのパス/cake/tmp
Permissions set on /プロジェクトのパス/cake/logs
Updated Security.salt value in config/app_local.php
 途中、赤色で不安なメッセージが出たりしますが・・・一応作成されたようです。  直下の「composer.json」を見ると

        "cakephp/cakephp": "3.9.*",
 となっちょりました。
ハイスピードプランマイニングベース