Mac Laravel のドッカー セイル構築の問題について話しましょう
最初に独り言を書く
私は 2 年以上 PHP でコードを書いていませんでしたが、今再び PHP を始めています。 TPですが、TPのバージョンアップが非常に不親切なので、今回はLaravelをワンステップで使います。まずは Docker 環境から始めましょう。やりながら書いていきます。皆さんも私と交流して、もっと教えてください。また、私の初心者の経験が誰かの役に立てば幸いです。
#[推奨:laravel チュートリアル ]
1. Docker デスクトップのインストール
フォーラムの詳細なチュートリアル2. コンテナーを実行します (「ピット」に遭遇しました!)
チュートリアルを段階的に実行しましたが、6 番目のステップまでは操作がスムーズに進みませんでした。状況ERROR: Service 'laravel.test' failed to build : Build failed
#9 7.166 Some packages could not be installed. This may mean that you have #9 7.166 requested an impossible situation or if you are using the unstable #9 7.166 distribution that some required packages have not yet been created #9 7.166 or been moved out of Incoming.#9 7.166 The following information may help to resolve the situation:#9 7.166#9 7.166 The following packages have unmet dependencies:#9 7.262 gnupg : Depends: gpgv (< 2.2.19-3ubuntu2.1.1~) but 2.2.20-1ubuntu3 is to be installed #9 7.264 perl : Depends: perl-base (= 5.30.0-9ubuntu0.2) but 5.32.1-3ubuntu2.1 is to be installed #9 7.264 Recommends: netbase but it is not going to be installed #9 7.264 perl-base : Breaks: perl (< 5.32.1~) but 5.30.0-9ubuntu0.2 is to be installed #9 7.265 zlib1g-dev : Depends: zlib1g (= 1:1.2.11.dfsg-2ubuntu1.2) but 1:1.2.11.dfsg-2ubuntu6 is to be installed #9 7.265 Depends: libc6-dev but it is not going to be installed or #9 7.265 libc-dev #9 7.283 E: Unable to correct problems, you have held broken packages.
#9 7.262 gnupg : Depends: gpgv (< 2.2.19-3ubuntu2.1.1~) but 2.2.20-1ubuntu3 is to be installed
apt-get がインストールされているので、
apt-get を
aptitude に置き換えてみました。
apt-get とは異なり、
aptitude
RUN apt-get update \ && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 \
RUN apt-get update \ && apt-get install -y aptitude \ && aptitude install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 \
Run again
./vendor/bin/sail up## に変更しました。 #状況は変わりましたが、依然としてエラーが報告されます
#9 32.31 E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation
インストールは成功しませんでしたが、実行されました。
もう一度試しましたapt-get install -f
それでもまだ効果なし
わかりました、気が変わって調べてみました。上記の上位バージョンがインストールされているので、上位の ubuntu に基づいて実行するので、FROM
を変更しました。
FROM ubuntu:21.04
を
FROM ubuntu:latest
に変更しました。新しい依存関係の問題が発生します
#9 44.96 Some packages could not be installed. This may mean that you have #9 44.96 requested an impossible situation or if you are using the unstable #9 44.96 distribution that some required packages have not yet been created #9 44.96 or been moved out of Incoming.#9 44.96 The following information may help to resolve the situation:#9 44.96#9 44.96 The following packages have unmet dependencies:#9 45.08 php8.0-bcmath : Depends: php8.0-common (= 8.0.12-1+ubuntu21.04.1+deb.sury.org+1) but it is not going to be installed #9 45.08 php8.0-cli : Depends: php8.0-common (= 8.0.12-1+ubuntu21.04.1+deb.sury.org+1) but it is not going to be installed #9 45.08 Depends: php8.0-opcache but it is not going to be installed #9 45.08 Depends: libc6 (>= 2.33) but 2.31-0ubuntu9.2 is to be installed #9 45.08 Depends: libxml2 (>= 2.8.0) but it is not going to be installed #9 45.08 php8.0-curl : Depends: php8.0-common (= 8.0.12-1+ubuntu21.04.1+deb.sury.org+1) but it is not going to be installed #9 45.08 php8.0-dev : Depends: php8.0-common (= 8.0.12-1+ubuntu21.04.1+deb.sury.org+1) but it is not going to be installed #9 45.08 Recommends: pkg-php-tools but it is not going to be installed #9 45.08 php8.0-gd : Depends: php8.0-common (= 8.0.12-1+ubuntu21.04.1+deb.sury.org+1) but it is not going to be installed #9 45.08 php8.0-igbinary : Depends: php8.0-common but it is not going to be installed #9 45.08 php8.0-imap : Depends: php8.0-common (= 8.0.12-1+ubuntu21.04.1+deb.sury.org+1) but it is not going to be installed #9 45.08 php8.0-intl : Depends: php8.0-common (= 8.0.12-1+ubuntu21.04.1+deb.sury.org+1) but it is not going to be installed #9 45.08 Depends: libicu67 (>= 67.1-1~) but it is not installable #9 45.08 php8.0-ldap : Depends: php8.0-common (= 8.0.12-1+ubuntu21.04.1+deb.sury.org+1) but it is not going to be installed #9 45.08 php8.0-mbstring : Depends: php8.0-common (= 8.0.12-1+ubuntu21.04.1+deb.sury.org+1) but it is not going to be installed #9 45.08 php8.0-memcached : Depends: php8.0-common but it is not going to be installed #9 45.08 php8.0-msgpack : Depends: php8.0-common but it is not going to be installed #9 45.08 php8.0-mysql : Depends: php8.0-common (= 8.0.12-1+ubuntu21.04.1+deb.sury.org+1) but it is not going to be installed #9 45.08 php8.0-pcov : Depends: php8.0-common but it is not going to be installed #9 45.08 Depends: libc6 (>= 2.33) but 2.31-0ubuntu9.2 is to be installed #9 45.08 php8.0-pgsql : Depends: php8.0-common (= 8.0.12-1+ubuntu21.04.1+deb.sury.org+1) but it is not going to be installed #9 45.08 php8.0-readline : Depends: php8.0-common (= 8.0.12-1+ubuntu21.04.1+deb.sury.org+1) but it is not going to be installed #9 45.08 php8.0-redis : Depends: php8.0-common but it is not going to be installed #9 45.08 php8.0-soap : Depends: php8.0-common (= 8.0.12-1+ubuntu21.04.1+deb.sury.org+1) but it is not going to be installed #9 45.08 Depends: libc6 (>= 2.33) but 2.31-0ubuntu9.2 is to be installed #9 45.08 Depends: libxml2 (>= 2.7.4) but it is not going to be installed #9 45.08 php8.0-sqlite3 : Depends: php8.0-common (= 8.0.12-1+ubuntu21.04.1+deb.sury.org+1) but it is not going to be installed #9 45.08 php8.0-swoole : Depends: php8.0-common but it is not going to be installed #9 45.08 Depends: libc6 (>= 2.33) but 2.31-0ubuntu9.2 is to be installed #9 45.08 php8.0-xdebug : Depends: php8.0-common but it is not going to be installed #9 45.08 Depends: libc6 (>= 2.33) but 2.31-0ubuntu9.2 is to be installed #9 45.08 php8.0-xml : Depends: php8.0-common (= 8.0.12-1+ubuntu21.04.1+deb.sury.org+1) but it is not going to be installed #9 45.08 Depends: libc6 (>= 2.33) but 2.31-0ubuntu9.2 is to be installed #9 45.08 Depends: libxml2 (>= 2.9.0) but it is not going to be installed #9 45.08 Depends: libxslt1.1 (>= 1.1.25) but it is not going to be installed #9 45.08 php8.0-zip : Depends: php8.0-common (= 8.0.12-1+ubuntu21.04.1+deb.sury.org+1) but it is not going to be installed #9 45.08 Depends: libc6 (>= 2.33) but 2.31-0ubuntu9.2 is to be installed #9 45.08 Depends: libzip4 (>= 1.7.0) but it is not installable #9 45.10 E: Unable to correct problems, you have held broken packages.
検索した結果、解決策が見つかったようです
Solve it with downgrade sail composer require laravel/sail:^1.7.0 php artisan sail:install and in ubuntu terminal sail up --build
さて、試し続けてください。まず
composer require laravel/sail:^1.7.0
を実行してエラーを見つけます。特定のエラーは忘れられます。
php のバージョンが 7.x であることを確認したので、brew install php
を実行したところ、エラーが発生しました。
Error: Failure while executing; `cp -pR /var/folders/vq/934y4t116875gz570v8drdcm0000gn/T/d20211115-17671-1n3qf1o/openssl@1.1/. /usr/local/Cellar/openssl@1.1` exited with 1. Here's the output:cp: utimes: /usr/local/Cellar/openssl@1.1/.: Operation not permitted cp: chmod: /usr/local/Cellar/openssl@1.1/.: Operation not permitted
確認したところ、 sudo brew install を使用しました。php
Error: Running Homebrew as root is extremely dangerous and no longer supported.As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system.
sudo がサポートされていないことがわかりました。
Sosudo chown -R $(whoami) /usr/local/Cellar
ディレクトリのアクセス許可の変更
通常の操作
使用 php -v
バージョンを確認するか、 7.0
ファイル内でbrew unlink php70
brew link php
sudo vim ~/.bash_profile
を使用します。最後に
PATH="$(brew --prefix php)/bin:$PATH"export PYTHON_ENV=development
php -v
php8.0 を追加すると、
PHP 8.0.12 (cli) (built: Oct 21 2021 14:49:05) ( NTS )Copyright (c) The PHP Group Zend Engine v4.0.12, Copyright (c) Zend Technologies
Continue
composer require laravel/sail:^1.7.0
ではないことがわかりました。見つかりました。国産かもしれないと思いました コンポーザーのソースに問題があります
[InvalidArgumentException] Could not find package laravel/laravel with stability stable
コンポーザーの中国語のイメージをインストールしました実は、コンポーザーの中国語のイメージに問題がありました。後で直接変更しました別のアドレスに変更しました。
composer config -g repo.packagist composer https://packagist.org
成功しました。
ステップ 2
php artisan sail:install
成功しました。
ステップ 3
sail up
成功。問題を解く。
最後のローカルホスト
以上がMac Laravel のドッカー セイル構築の問題について話しましょうの詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

Video Face Swap
完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

人気の記事

ホットツール

メモ帳++7.3.1
使いやすく無料のコードエディター

SublimeText3 中国語版
中国語版、とても使いやすい

ゼンドスタジオ 13.0.1
強力な PHP 統合開発環境

ドリームウィーバー CS6
ビジュアル Web 開発ツール

SublimeText3 Mac版
神レベルのコード編集ソフト(SublimeText3)

ホットトピック











LaravelEloquentモデルの検索:データベースデータを簡単に取得するEloquentormは、データベースを操作するための簡潔で理解しやすい方法を提供します。この記事では、さまざまな雄弁なモデル検索手法を詳細に紹介して、データベースからのデータを効率的に取得するのに役立ちます。 1.すべてのレコードを取得します。 ALL()メソッドを使用して、データベーステーブルですべてのレコードを取得します:useapp \ models \ post; $ post = post :: all();これにより、コレクションが返されます。 Foreach Loopまたはその他の収集方法を使用してデータにアクセスできます。

Laravelは、Webアプリケーションを簡単に構築するためのPHPフレームワークです。次のような強力な機能を提供します。インストール:Laravel CLIを作曲家にグローバルにインストールし、プロジェクトディレクトリにアプリケーションを作成します。ルーティング:ルート/web.phpのURLとハンドラーの関係を定義します。ビュー:リソース/ビューでビューを作成して、アプリケーションのインターフェイスをレンダリングします。データベース統合:MySQLなどのデータベースとのすぐ外側の統合を提供し、移行を使用してテーブルを作成および変更します。モデルとコントローラー:モデルはデータベースエンティティを表し、コントローラーはHTTP要求を処理します。

CraftCMSを使用してWebサイトを開発する場合、特にCSSやJavaScriptファイルを頻繁に更新する場合、リソースファイルのキャッシュ問題が発生することがよくあります。古いバージョンのファイルがブラウザによってキャッシュされ、ユーザーが最新の変更を表示しないようにすることがあります。この問題は、ユーザーエクスペリエンスに影響を与えるだけでなく、開発とデバッグの難しさを高めます。最近、プロジェクトで同様のトラブルに遭遇し、いくつかの調査の後、プラグインWiejeben/Craft-Laravel-Mixが見つかりました。

Laravelは、ユーザーモデル(Eloquentモデル)の定義、ログインフォームの作成(ブレードテンプレートエンジン)、ログインコントローラーの作成(認証\ログインコントローラーの継承)、ログイン要求の検証(Auth ::試行)の検証など、ユーザーログイン機能を実装するための包括的なAuthフレームワークを提供します。ヘッダー。さらに、AUTHフレームワークは、パスワードのリセット、電子メールの登録と検証などの機能も提供します。詳細については、Laravelのドキュメントを参照してください:https://laravel.com/doc

Laravelはバックエンドロジックでどのように役割を果たしますか?ルーティングシステム、Eloquentorm、認証と承認、イベントとリスナー、パフォーマンスの最適化を通じてバックエンド開発を簡素化および強化します。 1.ルーティングシステムにより、URL構造の定義とリクエスト処理ロジックが可能になります。 2.Eloquentormは、データベースの相互作用を簡素化します。 3.認証および承認システムは、ユーザー管理に便利です。 4.イベントとリスナーは、ゆるく結合したコード構造を実装します。 5.パフォーマンスの最適化により、キャッシュとキューイングを通じてアプリケーションの効率が向上します。

記事の概要:この記事では、Laravelフレームワークを簡単にインストールする方法について読者をガイドするための詳細なステップバイステップの指示を提供します。 Laravelは、Webアプリケーションの開発プロセスを高速化する強力なPHPフレームワークです。このチュートリアルは、システム要件からデータベースの構成とルーティングの設定までのインストールプロセスをカバーしています。これらの手順に従うことにより、読者はLaravelプロジェクトのための強固な基盤を迅速かつ効率的に築くことができます。

Laravelフレームワークを学びたいが、資源や経済的圧力に苦しんでいないのですか?この記事では、Laravelの無料学習を提供し、オンラインプラットフォーム、ドキュメント、コミュニティフォーラムなどのリソースを使用して、PHP開発の旅から習得するための堅実な基盤を築く方法を教えてくれます。

Laravelフレームワークには、開発者のさまざまなニーズを満たすためにバージョン番号を簡単に表示するための組み込みの方法があります。この記事では、Composer Command Lineツールの使用、.ENVファイルへのアクセス、PHPコードを介したバージョン情報の取得など、これらの方法について説明します。これらの方法は、Laravelアプリケーションのバージョン化の維持と管理に不可欠です。
