PHP - Laravel - インストール - PHP 8.4 FreeBSD 14.3 - 初期設定


クラウディア 


1. 概要
2. ウェブサーバ設定
3. 初期表示
4. 初期設定

1. 概要

 以下、初期設定を行います。

2. ウェブサーバ設定

 ウェブサーバとして、「apache24」を使用しています。

/usr/local/etc/apache24/Includes/laravel.conf
 を作成して、下記を記述します。

Alias   /laravel       "/usr/local/www/laravel/public/"

<Directory "/usr/local/www/laravel/public/">
    Options +ExecCGI +Followsymlinks -Indexes +Includes
    AllowOverride All

    <RequireAll>
        Require all granted
    </RequireAll>
</Directory>
 これで。

service apache24 configtest

service apache24 restart
 して。

http://host_name/laravel/
 へアクセスすれば、初期表示が表示されます。

3. 初期表示

 この時点で、サイトへアクセスすると、下記のように表示されます。

4. 初期設定

 とりあえず、日本時間、日本語を設定しておきます。  ログインユーザで、「Laravel」のプロジェクトホームへ移動して。

vi ./config/app.php

    /*
    |--------------------------------------------------------------------------
    | Application Timezone
    |--------------------------------------------------------------------------
    |
    | Here you may specify the default timezone for your application, which
    | will be used by the PHP date and date-time functions. The timezone
    | is set to "UTC" by default as it is suitable for most use cases.
    |
    */

    'timezone' => 'UTC',
 を下記へ。

    'timezone' => 'Asia/Tokyo',

    /*
    |--------------------------------------------------------------------------
    | Application Locale Configuration
    |--------------------------------------------------------------------------
    |
    | The application locale determines the default locale that will be used
    | by Laravel's translation / localization methods. This option can be
    | set to any locale for which you plan to have translation strings.
    |
    */

    'locale' => env('APP_LOCALE', 'en'),

    'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),

    'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
 を下記へ。

    'locale' => env('APP_LOCALE', 'ja'),

    'fallback_locale' => env('APP_FALLBACK_LOCALE', 'ja'),

    'faker_locale' => env('APP_FAKER_LOCALE', 'ja_JP'),
 日本語訳のメッセージファイルは、前ページで作成した、下記のものが効いているはずです。

lang
|-- ja
|   |-- auth.php
|   |-- pagination.php
|   |-- passwords.php
|   `-- validation.php
`-- ja.json
 実は、途中で、少しトラブルがありましたが、うまくインストールできました。

AbemaTV 無料体験
損保との違い