9cubed
ブログ | Tailwind | Vite | Python | MariaDB | Node.js | Linux | PowerShell | Docker | Git | その他 | 将棋ウォーズ | 歌の練習
CentOS7

Laravel のインストール

公開日:2020-02-02
更新日:2020-07-21

1. 概要

PHP用Webアプリフレームワークである Laravel のインストールします。

2. Laravel のインストール


事前準備
yum install zip unzip
yum install --enablerepo=remi-php74 php-zip
yum install --enablerepo=remi-php74 php-dom

以下の警告やエラーが出る場合は、上記のインストールを行ってください。

As there is no 'unzip' command installed zip files are being unpacked using the PHP zip extension.
This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.
Installing 'unzip' may remediate them.
  Problem 1
    - laravel/installer v3.0.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - laravel/installer v3.0.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - Installation request for laravel/installer ^3.0 -> satisfiable by laravel/installer[v3.0.0, v3.0.1].
  Problem 1
    - Installation request for tijsverkoyen/css-to-inline-styles 2.2.2 -> satisfiable by tijsverkoyen/css-to-inline-styles[2.2.2].
    - tijsverkoyen/css-to-inline-styles 2.2.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.

Laravelインストーラーの作成
cd /var/www/html
mkdir laravel
cd laravel
composer require laravel/installer

Laravelプロジェクトの作成
cd /var/www/html
/var/www/html/laravel/vendor/bin/laravel new laravel_test

http://192.168.233.100/laravel_test/public/ にアクセスして、
以下のエラーが表示されれば OK です。

UnexpectedValueException
The stream or file "/var/www/html/laravel_test/storage/logs/laravel.log" could not be opened: 
failed to open stream: Permission denied

これはログ出力の権限が不足しているためです。
プロジェクト全体を apache ユーザに変更します。
chown apache:apache /var/www/html/laravel_test -R

http://192.168.233.100/laravel_test/public/ にアクセスして、
「Laravel」と書かれは画面が表示されれば OK です。

まだエラーが出る場合は、SELinux の設定を確認してください。
確認
ls -alZ

設定
chcon -R -t httpd_sys_rw_content_t /var/www/html/laravel_test

YouTube X

新着一覧

  • テーブル結合(CROSS JOIN、INNER JOIN、LEFT JOIN)MariaDB
  • 楽観ロック・悲観ロックMariaDB
  • カレントリードMariaDB
  • インデックスMariaDB
  • 論理削除(ソフトデリート)MariaDB
  • awk(オーク)の使い方についてLinux
  • NOT NULL 制約と NULL を許容した時の動作MariaDB
  • 外部キー制約MariaDB
  • MySQL と MariaDB の関係MariaDB
  • Docker で PostgreSQL のコンテナの使用Linux

アーカイブ

  • 2026/01
  • 2025/12
  • 2025/11
  • 2025/10
  • 2025/09
  • 2025/08
  • /00

以前のカテゴリー一覧

  • CakePHP3
  • CentOS7
  • HTML・CSS・JavaScript
  • Haskell
  • JavaScript
  • Kotlin
  • Laravel5
  • PHP
  • Python
  • Ruby
  • RubyOnRails5
  • TypeScript
  • Vue.js
  • Webサーバ講座
  • Webプログラミング講座
  • jQuery
  • linux
  • パソコン講座
  • ブログ
  • プログラミング講座
  • メモ帳作成講座
  • 数学

Copyright © 9cubed. All Rights Reserved.

プライバシーポリシー 利用規約
▲