PHP - PHP 7.4 → 8.0 - Laravel
1. 概要 表題のとおり、「Laravel」もついでにアップデートしておこうと思います。 試行錯誤の途中では、「Laravel」も動かなくなってしまったりしたのですが、最終的な手順をふめば、「Laravel」は、何の手をいれなくても機能していました。 2. アップデート 「Larave」のプロジェクトへ移動して実行します。 composer.json は、既に下記のように書いてあるので、問題ないのかしら・・・。 "license": "MIT", "require": { "php": "^7.4.14|^8.0", "fideloper/proxy": "^4.4", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^6.3.1|^7.0.1", "laravel/framework": "^7.29", "laravel/tinker": "^2.5" }, いたん、「root」ユーザ権限で。 chown -R 管理ユーザ /パス/bootstrap/cache 「Laravel」の管理者ユーザ権限で。 composer update なんかうまくいったんで全文掲載しちゃいますが(長くてごめんなさい)。 Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 0 installs, 44 updates, 0 removals - Updating guzzlehttp/psr7 (1.7.0 => 1.8.1): Downloading (100%) - Updating guzzlehttp/promises (1.4.0 => 1.4.1): Downloading (100%) - Updating guzzlehttp/guzzle (7.2.0 => 7.3.0): Downloading (100%) - Updating symfony/polyfill-php80 (v1.22.0 => v1.22.1): Loading from cache - Updating symfony/polyfill-mbstring (v1.22.0 => v1.22.1): Downloading (100%) - Updating symfony/var-dumper (v5.2.1 => v5.2.5): Downloading (100%) - Updating symfony/polyfill-php72 (v1.22.0 => v1.22.1): Loading from cache - Updating symfony/polyfill-intl-normalizer (v1.22.0 => v1.22.1): Downloading (100%) - Updating symfony/polyfill-intl-grapheme (v1.22.0 => v1.22.1): Downloading (100%) - Updating symfony/polyfill-ctype (v1.22.0 => v1.22.1): Loading from cache - Updating symfony/string (v5.2.1 => v5.2.4): Downloading (100%) - Updating psr/container (1.0.0 => 1.1.1): Downloading (100%) - Updating symfony/polyfill-php73 (v1.22.0 => v1.22.1): Loading from cache - Updating symfony/console (v5.2.1 => v5.2.5): Downloading (100%) - Updating psy/psysh (v0.10.5 => v0.10.7): Downloading (100%) - Updating vlucas/phpdotenv (v4.1.8 => v4.2.0): Downloading (100%) - Updating symfony/css-selector (v5.2.1 => v5.2.4): Downloading (100%) - Updating symfony/routing (v5.2.1 => v5.2.4): Downloading (100%) - Updating symfony/process (v5.2.1 => v5.2.4): Downloading (100%) - Updating symfony/polyfill-intl-idn (v1.22.0 => v1.22.1): Downloading (100%) - Updating symfony/mime (v5.2.1 => v5.2.5): Downloading (100%) - Updating webmozart/assert (1.9.1 => 1.10.0): Downloading (100%) - Updating symfony/http-foundation (v5.2.1 => v5.2.4): Downloading (100%) - Updating symfony/event-dispatcher (v5.2.1 => v5.2.4): Downloading (100%) - Updating symfony/error-handler (v5.2.1 => v5.2.4): Downloading (100%) - Updating symfony/http-kernel (v5.2.1 => v5.2.5): Downloading (100%) - Updating symfony/finder (v5.2.1 => v5.2.4): Downloading (100%) - Updating symfony/polyfill-iconv (v1.22.0 => v1.22.1): Downloading (100%) - Updating swiftmailer/swiftmailer (v6.2.5 => v6.2.7): Downloading (100%) - Updating ramsey/collection (1.1.1 => 1.1.3): Downloading (100%) - Updating brick/math (0.9.1 => 0.9.2): Downloading (100%) - Updating symfony/translation (v5.2.1 => v5.2.5): Downloading (100%) - Updating nesbot/carbon (2.43.0 => 2.46.0): Downloading (100%) - Updating league/mime-type-detection (1.5.1 => 1.7.0): Downloading (100%) - Updating laravel/framework (v7.30.3 => v7.30.4): Downloading (100%) - Updating laravel/tinker (v2.5.0 => v2.6.1): Downloading (100%) - Updating filp/whoops (2.9.1 => 2.11.0): Downloading (100%) - Updating facade/flare-client-php (1.3.7 => 1.4.0): Downloading (100%) - Updating facade/ignition (2.5.8 => 2.6.0): Downloading (100%) - Updating mockery/mockery (1.4.2 => 1.4.3): Downloading (100%) - Updating phpspec/prophecy (1.12.2 => 1.13.0): Downloading (100%) - Updating phar-io/version (3.0.4 => 3.1.0): Downloading (100%) - Updating phpunit/phpunit (9.5.1 => 9.5.4): Downloading (100%) - Updating asm89/stack-cors (v2.0.2 => v2.0.3): Downloading (100%) Writing lock file Generating optimized autoload files > Illuminate\Foundation\ComposerScripts::postAutoloadDump > @php artisan package:discover --ansi Discovered Package: facade/ignition Discovered Package: fideloper/proxy Discovered Package: fruitcake/laravel-cors Discovered Package: laravel/tinker Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Package manifest generated successfully. 73 packages you are using are looking for funding. Use the `composer fund` command to find out more! 終了後、「root」ユーザ権限で。 chown -R www:www /パス/bootstrap/cache 念のため service apache24 configtest service apache24 restart 後、ブラウザで確認しましたが、特に問題はありませんでした。 3. バージョン php /パス/artisan --version で確認した、「Laravel」のバージョンは、作業前が Laravel Framework 7.30.1 作業後が Laravel Framework 7.30.4 でした。
composer.json
"license": "MIT", "require": { "php": "^7.4.14|^8.0", "fideloper/proxy": "^4.4", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^6.3.1|^7.0.1", "laravel/framework": "^7.29", "laravel/tinker": "^2.5" },
chown -R 管理ユーザ /パス/bootstrap/cache
composer update
Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 0 installs, 44 updates, 0 removals - Updating guzzlehttp/psr7 (1.7.0 => 1.8.1): Downloading (100%) - Updating guzzlehttp/promises (1.4.0 => 1.4.1): Downloading (100%) - Updating guzzlehttp/guzzle (7.2.0 => 7.3.0): Downloading (100%) - Updating symfony/polyfill-php80 (v1.22.0 => v1.22.1): Loading from cache - Updating symfony/polyfill-mbstring (v1.22.0 => v1.22.1): Downloading (100%) - Updating symfony/var-dumper (v5.2.1 => v5.2.5): Downloading (100%) - Updating symfony/polyfill-php72 (v1.22.0 => v1.22.1): Loading from cache - Updating symfony/polyfill-intl-normalizer (v1.22.0 => v1.22.1): Downloading (100%) - Updating symfony/polyfill-intl-grapheme (v1.22.0 => v1.22.1): Downloading (100%) - Updating symfony/polyfill-ctype (v1.22.0 => v1.22.1): Loading from cache - Updating symfony/string (v5.2.1 => v5.2.4): Downloading (100%) - Updating psr/container (1.0.0 => 1.1.1): Downloading (100%) - Updating symfony/polyfill-php73 (v1.22.0 => v1.22.1): Loading from cache - Updating symfony/console (v5.2.1 => v5.2.5): Downloading (100%) - Updating psy/psysh (v0.10.5 => v0.10.7): Downloading (100%) - Updating vlucas/phpdotenv (v4.1.8 => v4.2.0): Downloading (100%) - Updating symfony/css-selector (v5.2.1 => v5.2.4): Downloading (100%) - Updating symfony/routing (v5.2.1 => v5.2.4): Downloading (100%) - Updating symfony/process (v5.2.1 => v5.2.4): Downloading (100%) - Updating symfony/polyfill-intl-idn (v1.22.0 => v1.22.1): Downloading (100%) - Updating symfony/mime (v5.2.1 => v5.2.5): Downloading (100%) - Updating webmozart/assert (1.9.1 => 1.10.0): Downloading (100%) - Updating symfony/http-foundation (v5.2.1 => v5.2.4): Downloading (100%) - Updating symfony/event-dispatcher (v5.2.1 => v5.2.4): Downloading (100%) - Updating symfony/error-handler (v5.2.1 => v5.2.4): Downloading (100%) - Updating symfony/http-kernel (v5.2.1 => v5.2.5): Downloading (100%) - Updating symfony/finder (v5.2.1 => v5.2.4): Downloading (100%) - Updating symfony/polyfill-iconv (v1.22.0 => v1.22.1): Downloading (100%) - Updating swiftmailer/swiftmailer (v6.2.5 => v6.2.7): Downloading (100%) - Updating ramsey/collection (1.1.1 => 1.1.3): Downloading (100%) - Updating brick/math (0.9.1 => 0.9.2): Downloading (100%) - Updating symfony/translation (v5.2.1 => v5.2.5): Downloading (100%) - Updating nesbot/carbon (2.43.0 => 2.46.0): Downloading (100%) - Updating league/mime-type-detection (1.5.1 => 1.7.0): Downloading (100%) - Updating laravel/framework (v7.30.3 => v7.30.4): Downloading (100%) - Updating laravel/tinker (v2.5.0 => v2.6.1): Downloading (100%) - Updating filp/whoops (2.9.1 => 2.11.0): Downloading (100%) - Updating facade/flare-client-php (1.3.7 => 1.4.0): Downloading (100%) - Updating facade/ignition (2.5.8 => 2.6.0): Downloading (100%) - Updating mockery/mockery (1.4.2 => 1.4.3): Downloading (100%) - Updating phpspec/prophecy (1.12.2 => 1.13.0): Downloading (100%) - Updating phar-io/version (3.0.4 => 3.1.0): Downloading (100%) - Updating phpunit/phpunit (9.5.1 => 9.5.4): Downloading (100%) - Updating asm89/stack-cors (v2.0.2 => v2.0.3): Downloading (100%) Writing lock file Generating optimized autoload files > Illuminate\Foundation\ComposerScripts::postAutoloadDump > @php artisan package:discover --ansi Discovered Package: facade/ignition Discovered Package: fideloper/proxy Discovered Package: fruitcake/laravel-cors Discovered Package: laravel/tinker Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Package manifest generated successfully. 73 packages you are using are looking for funding. Use the `composer fund` command to find out more!
chown -R www:www /パス/bootstrap/cache
service apache24 configtest service apache24 restart
php /パス/artisan --version
Laravel Framework 7.30.1
Laravel Framework 7.30.4