前提・実現したいこと
https://qiita.com/sskmy1024y/items/c2e434941400bd4ee82c
を参考にさくらサーバーでlaravelを動かそうとした。
とりあえず、viewのn_user_log.blade.php
というログイン画面だけでも表示させたい。mysqlはまだ設定していない。
/home/ユーザー/laravel/newpro(prioect名)にプロジェクトがあり、
/var/www/html/newproにpublicの中身をコピーした。参考にしたQiitaどおりである。
発生している問題・エラーメッセージ
http://ipアドレス/newpro/index.php と検索しても以下のエラーがでる
HTTP ERROR 500
apacheのエラー
[Sat Jun 13 16:19:34.426402 2020] [php7:warn] [pid 14648] [client 180.0.139.63:59861] PHP Warning: require(/var/www/html/newpro/../../laravel/newpro/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/newpro/index.php on line 24 [Sat Jun 13 16:19:34.426516 2020] [php7:error] [pid 14648] [client 180.0.139.63:59861] PHP Fatal error: require(): Failed opening required '/var/www/html/newpro/../../laravel/newpro/vendor/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/newpro/index.php on line 24
/var/www/html/newpro/index.phpの24行目は以下です。
require __DIR__.'/../../laravel/newpro/vendor/autoload.php';
laravel/newpro/vendor/autoload.phpの中身は以下です。
// autoload.php @generated by Composer require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit10a0efddbedf8959c8df19c82f98907d::getLoader();
試したこと
/var/www/html/newpro
drwxrwxr-x 5 apache webgroup 4096 Jun 13 17:08 .
drwxrwxr-x 3 apache webgroup 4096 Jun 13 16:11 ..
-rwxrwxr-x 1 ユーザー名 ユーザー名 596 Jun 13 15:03 .htaccess
drwxrwxr-x 2 ユーザー名 ユーザー名 4096 Jun 13 14:39 css
-rwxrwxr-x 1 ユーザー名 ユーザー名 0 Jun 13 14:39 favicon.ico
-rwxrwxr-x 1 ユーザー名 ユーザー名 1859 Jun 13 14:41 index.php
drwxrwxr-x 2 ユーザー名 ユーザー名 4096 Jun 13 14:39 js
-rwxrwxr-x 1 ユーザー名 ユーザー名 24 Jun 13 14:39 robots.txt
drwxrwxr-x 2 ユーザー名 ユーザー名 4096 Jun 13 14:39 storage
.env
APP_NAME=Laravel
APP_ENV=production
APP_KEY=base64:4ZdzcXWTRzssKtBKzF44uqLwvXG4fHVwX7JdDJ5RUI8=
APP_DEBUG=false
APP_URL=http://160.16.218.27
補足情報(FW/ツールのバージョンなど)
centOS7 Apache2.4 php7.4
php
sudo yum -y install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm sudo yum install --enablerepo=remi,remi-php74 php php-devel php-mbstring php-pdo php-xml php-zip1
apache
sudo yum install httpd
composer install -vvvすると以下のような見慣れないエラー文句がでていました。
Failed to initialize global composer: Composer could not find the config file: /home/satoshi/.config/composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Reading /home/satoshi/laravel/newpro/vendor/composer/installed.json
Running 1.10.7 (2020-06-03 10:03:56) with PHP 7.4.7 on Linux / 3.10.0-1127.8.2.el7.x86_64
Reading ./composer.lock
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Reading ./composer.lock
Resolving dependencies through SAT
Looking at all rules.
.htaccessの中身
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> コメントアウトOptions -MultiViews -Indexes </IfModule> RewriteEngine On RewriteBase / コメントアウト Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] コメントアウト Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] コメントアウト Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule>
/etc/httpd/conf/httpd.conf
<Directory "/var/www/html"> コメントアウト コメントアウト Possible values for the Options directive are "None", "All", コメントアウト or any combination of: コメントアウト Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews コメントアウト コメントアウト Note that "MultiViews" must be named *explicitly* --- "Options All" コメントアウト doesn't give it to you. コメントアウト コメントアウト The Options directive is both complicated and important. Please see コメントアウト http://httpd.apache.org/docs/2.4/mod/core.html#options コメントアウト for more information. コメントアウト Options Indexes FollowSymLinks コメントアウト コメントアウト 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 コメントアウト コメントアウト Controls who can get stuff from this server. コメントアウト Require all granted </Directory>
回答2件
あなたの回答
tips
プレビュー