質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Laravel

LaravelとはTaylor Otwellによって開発された、オープンソースなPHPフレームワークです。Laravelはシンプルで表現的なシンタックスを持ち合わせており、ウェブアプリケーション開発の手助けをしてくれます。

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

composer

Composerとは、PHP5.3.2以上で使用可能なパッケージ管理ツールです。指定ディレクトリ内だけでパッケージ管理します。

Q&A

解決済

1回答

1911閲覧

ロリポップでcomposerを実行した際のメモリ不足を回避したい

shin19jp

総合スコア13

Laravel

LaravelとはTaylor Otwellによって開発された、オープンソースなPHPフレームワークです。Laravelはシンプルで表現的なシンタックスを持ち合わせており、ウェブアプリケーション開発の手助けをしてくれます。

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

composer

Composerとは、PHP5.3.2以上で使用可能なパッケージ管理ツールです。指定ディレクトリ内だけでパッケージ管理します。

0グッド

0クリップ

投稿2023/02/03 12:43

実現したいこと

ロリポップにLaravel/Breezeを導入しようとしていますが、
「composer require laravel/breeze」を入力すると、メモリ不足のようで止まってしまいます。

前提

ロリポップのハイスピードプランなので、フル権限がありません。

発生している問題・エラーメッセージ

PHP Deprecated: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/console/Helper/HelperSet.php on line 112 Deprecated: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/console/Helper/HelperSet.php on line 112 Deprecation Notice: Optional parameter $schema declared before required parameter $path is implicitly treated as a required parameter in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:62 Deprecation Notice: Optional parameter $schema declared before required parameter $path is implicitly treated as a required parameter in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:108 Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48 Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/src/Composer/Repository/ArrayRepository.php:206 Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/src/Composer/Repository/ArrayRepository.php:206 Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/src/Composer/Repository/ArrayRepository.php:206 Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryManager.php:130 Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryManager.php:130 Deprecation Notice: Optional parameter $blacklist declared before required parameter $ambiguousClasses is implicitly treated as a required parameter in phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:339 Deprecation Notice: Optional parameter $namespaceFilter declared before required parameter $ambiguousClasses is implicitly treated as a required parameter in phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:339 Deprecation Notice: Optional parameter $autoloadType declared before required parameter $ambiguousClasses is implicitly treated as a required parameter in phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:339 Deprecation Notice: Return type of Composer\Repository\CompositeRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/src/Composer/Repository/CompositeRepository.php:139 Deprecation Notice: Return type of Composer\DependencyResolver\Pool::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Pool.php:166 Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/ Info from https://repo.packagist.org: #StandWithUkraine Using version ^1.18 for laravel/breeze ./composer.json has been updated Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48 Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryManager.php:130 Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryManager.php:130 Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/src/Composer/Repository/ArrayRepository.php:206 Loading composer repositories with package information Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/ Info from https://repo.packagist.org: #StandWithUkraine Updating dependencies (including require-dev) Deprecation Notice: Return type of Composer\DependencyResolver\RuleSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSet.php:114 Deprecation Notice: Return type of Composer\DependencyResolver\RuleSet::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSet.php:99 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory PHP Fatal error: Out of memory (allocated 673734656) (tried to allocate 20480 bytes) in phar:///usr/local/bin/composer/src/Composer/Json/JsonFile.php on line 288 Fatal error: Out of memory (allocated 673734656) (tried to allocate 20480 bytes) in phar:///usr/local/bin/composer/src/Composer/Json/JsonFile.php on line 288

該当のソースコード

ssh

1composer require laravel/breeze

試したこと

「COMPOSER_MEMORY_LIMIT=-1 composer require laravel/breeze」
は結果が変わりませんでした。

ローカルで「composer require laravel/breeze」を実行して生成されたファイルをアップロードして進めようとしてみましたが、「php artisan breeze:install」を実行すると、
「ERROR There are no commands defined in the "breeze" namespace.」
となり、サーバーとローカルの整合性を持たせるための操作が分かりませんでした。

補足情報(FW/ツールのバージョンなど)

PHP8.1
Laravel9

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

AbeTakashi

2023/02/03 17:14

vendor/autoload.phpやcomposer.json等の関連ファイルもアップロードしましたか? vendor以下はまるっと全部アップロードしたらいいのかもしれません。こういうことはやったことないので分かりませんが、もしbreezeディレクトリ以外のファイルを上げてないのならそれで上手く行く可能性があるかもとは思いました。 まぁ、Laravel使うならこれ以外にも色々と苦労しそうな感じはあるので、普通にメモリ不足が起きないサーバに乗り換えるのが一番かとは思います。
shin19jp

2023/02/06 06:03

関連ファイルの中身に差異があったため、上書きすると別の問題が発生していまうかと思い、laravel\Breezeのみをアップロードしていましたが、確かに試していなかったため、全て上書きでアップロードしてみました。 すると、以下のようなエラーが発生しました。 PHP Fatal error: Uncaught Error: Class "ComposerAutoloaderInitdc3e6b6ffbcc814f807838364e8dd6dd" not found in ****/vendor/autoload.php:25 このエラーを解消するために2つのコマンドを実行する事で、エラーの解消とBreezeのインストールを進める事ができました。 $ composer update $ composer dumpautoload コメントいただき有難う御座いました。 サーバー選定については再検討したいと思います。
guest

回答1

0

自己解決

①vendor/Laravel/Breezeのみをアップロードしていたが、vendor直下全てをアップロード

②「php artisan breeze:install」とすると、autoload.phpのエラーが発生したため、以下のコマンドを実行

$ composer update
$ composer dumpautoload

③改めて「php artisan breeze:install」を実行

投稿2023/02/06 06:06

shin19jp

総合スコア13

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問