9cubed
ブログ | PHP | JavaScript | TypeScript | Vue.js | Laravel | Tailwind | Vite | Python | MariaDB | SQLite | Node.js | Linux | PowerShell | Docker | Git | Web | その他
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

新着一覧

  • async、awaitJavaScript
  • Promise についてJavaScript
  • パッケージの管理Node.js
  • v-model(双方向バインディング)Vue.js
  • VS Code で GitHub を使ったソース管理Git
  • computed(再計算)Vue.js
  • watchDebounced(値の監視)Vue.js
  • watch(値の監視)Vue.js
  • change イベントVue.js
  • v-memoVue.js

アーカイブ

  • 2026/03
  • 2026/02
  • 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.

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