前提・実現したいこと
MySQLを利用してLaravelの開発環境を作りたい。
よろしくお願いいたします。
OS mac Catalina 10.15.6
PHP 7.4.8
laravel 8.7.1
発生している問題・エラーメッセージ
migrateができない。
$php artisan migrate (中略) Fatal error: require(): Failed opening required '(path)/config/public/../ vendor/autoload.php' (include_path='.:/usr/local/Cellar/php/7.4.8/share/php/pear') in (path)/config/public/index.php on line 24
該当のソースコード
他必要なコードがあればご教授ください。
config/public/index.php
config/public/index.php
1 2<?php 3 4/** 5 * Laravel - A PHP Framework For Web Artisans 6 * 7 * @package Laravel 8 * @author Taylor Otwell <taylor@laravel.com> 9 */ 10 11define('LARAVEL_START', microtime(true)); 12 13/* 14|-------------------------------------------------------------------------- 15| Register The Auto Loader 16|-------------------------------------------------------------------------- 17| 18| Composer provides a convenient, automatically generated class loader for 19| our application. We just need to utilize it! We'll simply require it 20| into the script here so that we don't have to worry about manual 21| loading any of our classes later on. It feels great to relax. 22| 23*/ 24 25require __DIR__.'/../vendor/autoload.php'; 26 27/* 28|-------------------------------------------------------------------------- 29| Turn On The Lights 30|-------------------------------------------------------------------------- 31| 32| We need to illuminate PHP development, so let us turn on the lights. 33| This bootstraps the framework and gets it ready for use, then it 34| will load up this application so that we can run it and send 35| the responses back to the browser and delight our users. 36| 37*/ 38 39$app = require_once __DIR__.'/../bootstrap/app.php'; 40 41/* 42|-------------------------------------------------------------------------- 43| Run The Application 44|-------------------------------------------------------------------------- 45| 46| Once we have the application, we can handle the incoming request 47| through the kernel, and send the associated response back to 48| the client's browser allowing them to enjoy the creative 49| and wonderful application we have prepared for them. 50| 51*/ 52 53$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 54 55$response = $kernel->handle( 56 $request = Illuminate\Http\Request::capture() 57); 58 59$response->send(); 60 61$kernel->terminate($request, $response); 62
試したこと
調べた結果Composerのupdateが有効とのこと(下記を参照)。しかし、下記エラーが発生
リンク
↓結果
$composer update Loading composer repositories with package information Updating dependencies Nothing to modify in lock file Installing dependencies from lock file (including require-dev) Nothing to install, update or remove Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested. Generating optimized autoload files > Illuminate\Foundation\ComposerScripts::postAutoloadDump > @php artisan package:discover --ansi (中略) Fatal error: require(): Failed opening required '(path)/config/public/../ vendor/autoload.php' (include_path='.:/usr/local/Cellar/php/7.4.8/share/php/pear') in (path)/config/public/index.php on line 24 Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255
phpunit/php-token-streamが怪しいと思いましたが、これ以上は分からず、、、
Composer updateのエラーに対して試したこと
下を参考にbootstrap/cacheを削除しようとする。しかし、bootstrap下にcacheがない。
リンク
補足情報(FW/ツールのバージョンなど)
一応こちらも
composer.json
composer.json
1 2 3{ 4 "name": "laravel/laravel", 5 "type": "project", 6 "description": "The Laravel Framework.", 7 "keywords": [ 8 "framework", 9 "laravel" 10 ], 11 "license": "MIT", 12 "require": { 13 "php": "^7.2.5", 14 "fideloper/proxy": "^4.2", 15 "fruitcake/laravel-cors": "^2.0", 16 "guzzlehttp/guzzle": "^6.3", 17 "laravel/framework": "^7.24", 18 "laravel/tinker": "^2.0" 19 }, 20 "require-dev": { 21 "facade/ignition": "^2.0", 22 "fzaninotto/faker": "^1.9.1", 23 "mockery/mockery": "^1.3.1", 24 "nunomaduro/collision": "^4.1", 25 "phpunit/phpunit": "^8.5" 26 }, 27 "config": { 28 "optimize-autoloader": true, 29 "preferred-install": "dist", 30 "sort-packages": true 31 }, 32 "extra": { 33 "laravel": { 34 "dont-discover": [] 35 } 36 }, 37 "autoload": { 38 "psr-4": { 39 "App\": "app/" 40 }, 41 "classmap": [ 42 "database/seeds", 43 "database/factories" 44 ] 45 }, 46 "autoload-dev": { 47 "psr-4": { 48 "Tests\": "tests/" 49 } 50 }, 51 "minimum-stability": "dev", 52 "prefer-stable": true, 53 "scripts": { 54 "post-autoload-dump": [ 55 "Illuminate\Foundation\ComposerScripts::postAutoloadDump", 56 "@php artisan package:discover --ansi" 57 ], 58 "post-root-package-install": [ 59 "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 60 ], 61 "post-create-project-cmd": [ 62 "@php artisan key:generate --ansi" 63 ] 64 } 65} 66 67
vender/autoload.php
vender/autoload.php
1 2<?php 3 4// autoload.php @generated by Composer 5 6require_once __DIR__ . '/composer/autoload_real.php'; 7 8return ComposerAutoloaderInitf7dcb775c0e0ef4faf0000c62a23f466::getLoader(); 9 10
あなたの回答
tips
プレビュー