php8.2 パッケージをできるだけ早くインストールする方法を教えます (ubuntu 20.04 focus)
この記事では、php8.2 に関する関連知識を提供します。主に、php8.2 スイートを素早くインストールする方法を紹介し、説明します。どれくらい速いですか? 20 分ほどかかるかもしれません...見てみましょう。皆さんのお役に立てれば幸いです。
php8.2 パッケージをすばやくインストール (ubuntu 20.04 focus)
どれくらい速いですか?今回の試みの結果は、合計で約 20 分でした (オペレーティング システムを除く)。
また、私のコンピュータと同じ Alibaba Cloud ミラー ライブラリです。CentOS システム上で PHP を含むさまざまなソフトウェアをインストールするのは非常に速いですが、この Ubuntu をインストールするのは遅いです。理由は明らかではありません (考えられる理由の 1 つは、Ubuntu を使用している人が多すぎるため、Alibaba が少しでもコストを節約するためにソースのダウンロード速度を制限していることです。)
この記事の各ソフトウェアバージョン
ubuntu 20.04 php 8.2.1 nginx 1.22.1 mysql 8.0.31 redis 7.0.7 git 2.24.4
まず、Ali'swarewareをインストールします
首先必须 apt update 安装 vim vim /etc/apt/sources.list 内容如下,就是搞阿里云镜像。但是http的,被我改的。不搞无法更新。 deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse 然后 apt update apt install -y --reinstall ca-certificates 现在,再把阿里云镜像库中的 http 改成标准的 https, vim /etc/apt/sources.list deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse # deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse # deb-src https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse 然后。再次 apt update
php 8#をインストールします##
apt install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 dnsutils systemd gnupg2 lsb-release ubuntu-keyring 上面的命令需要选择多个选项。选亚洲 asia。选上海 shanghai curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /usr/share/keyrings/ppa_ondrej_php.gpg > /dev/null echo "deb [signed-by=/usr/share/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ppa_ondrej_php.list apt-get update apt-get install -y php8.2-cli php8.2-dev php8.2-pgsql php8.2-sqlite3 php8.2-gd php8.2-curl php8.2-imap php8.2-mysql php8.2-mbstring php8.2-xml php8.2-zip php8.2-bcmath php8.2-soap php8.2-intl php8.2-readline php8.2-ldap php8.2-msgpack php8.2-igbinary php8.2-redis php8.2-swoole php8.2-memcached php8.2-pcov php8.2-fpm php8.2-gmp php8.2-imagick php8.2-mcrypt php8.2-uuid php8.2-yaml
Alibaba のコンポーザー イメージ ソースをインストールします
curl -o /usr/local/bin/composer https://mirrors.aliyun.com/composer/composer.phar chmod +x /usr/local/bin/composer composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
vim /etc/environment
export COMPOSER_ALLOW_SUPERUSER=1
source /etc/environment
nginxをインストールし、php-fpmサービスを統合します
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor | tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" | tee /etc/apt/sources.list.d/nginx.list apt update apt install nginx 改php-fpm 配置。 sed -i 's/listen\ =\ \/run\/php\/php8.2-fpm.sock/listen\ =\ 127.0.0.1:9000/g' /etc/php/8.2/fpm/pool.d/www.conf 修改 /etc/nginx/nginx.conf 第一行 user www-data; 然后, rm -f /etc/nginx/conf.d/default.conf vi /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf 文件内容如下 server { listen 80; server_name localhost; charset utf-8 ; access_log /var/log/nginx/host.access.log main; root /usr/share/nginx/html; index index.php index.html index.htm; error_page 404 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; } }
vi /usr/share/nginx/html/1.php <?php phpinfo();
/etc/init.d/nginx start /etc/init.d/php8.2-fpm start curl localhost/1.php # 如果能看到很多的大量输出,说明php和nginx正确安装了。
mysql 8 をインストールします
apt install mysql-server-8.0 mysql-client-8.0 # 查看初始密码: grep 'temporary password' /var/log/mysqld.log # 用查看到的密码进入mysql 的 shell mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'tb4Wn3BthR.'; flush privileges; create user 'root'@'%' identified by 'root1234'; ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root1234'; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'; drop user root@localhost; flush privileges;
mysql -uroot -proot1234 # 这句话查看用户的加密方式。 select user, host, plugin from mysql.user\G; # plugin: caching_sha2_password 表示老的MySQL客户端无法连接!
redis 6 とその他の一般的に使用されるライブラリをインストールします
手順、redis 7 をインストールするには、バイナリ パッケージをコンパイルする必要があります、断固コンパイルしないのでやりませんでした。curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/redis.list apt-get update apt-get install redis-stack-server
上記のバージョンとは異なりますのでご注意ください。redis5 をインストールする場合
redis5 をインストールする場合は、ソースは必要ありません。直接アクセスしてくださいapt install redis-server
概要
Alibaba Cloud ミラー ライブラリのおかげですが、速度はそれほど速くありません。 推奨学習: 「PHP ビデオ チュートリアル 」
以上がphp8.2 パッケージをできるだけ早くインストールする方法を教えます (ubuntu 20.04 focus)の詳細内容です。詳細については、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)

ホットトピック







