이 기사에서는 php8.2에 대한 관련 지식을 제공합니다. 주로 php8.2 패키지를 빠르게 설치하는 방법을 소개하고 가르칩니다. 얼마나 빠른가요? 20분 정도 소요될 수 있으니... 한번 살펴보시고, 모두에게 도움이 되었으면 좋겠습니다.
php8.2 패키지의 빠른 설치(우분투 20.04 초점)
얼마나 빠르나요? 여기서 시도한 결과는 총 20분 정도입니다(운영 체제 제외).
또한 내 컴퓨터와 동일한 Alibaba Cloud 미러 라이브러리입니다. CentOS 시스템에 PHP를 포함한 다양한 소프트웨어를 설치하는 것은 매우 빠르지만 이 Ubuntu를 설치하는 것은 더 느립니다. (한 가지는 가능합니다. 이유는 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
먼저 Alibaba의 Warehouse를 설치합니다
首先必须 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
을 설치합니다. 위의 명령을 실행합니다. 대략 15분 정도 소요됩니다.
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/
루트 ID를 사용하여 작곡가 명령을 실행하면 yes를 입력하라는 메시지가 표시됩니다. 꽤 번거로운 작업입니다. 그런 다음
vim /etc/environment
text
export COMPOSER_ALLOW_SUPERUSER=1
그런 다음
source /etc/environment
nginx를 설치하고 통합합니다. php-fpm service
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; } }
다음과 같이 php 파일을 추가합니다.
vi /usr/share/nginx/html/1.php <?php phpinfo();
php-fpm과 nginx를 시작하고 설치가 제대로 되었는지 확인합니다
/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 중국어 웹사이트의 기타 관련 기사를 참조하세요!

이 안내서는 Windows, MacOS 및 Linux에 PHP 8 설치에 대해 자세히 설명합니다. 패키지 관리자 (홈 브루, APT) 사용, 소스의 수동 설치 및 APACHE 또는 NGINX로 PHP 구성을 포함한 OS 특정 단계를 다룹니다. 문제 해결 팁은 다음과 같습니다

이 기사는 PHP 8에서 이벤트 소싱 구현에 대해 자세히 설명합니다. 도메인 이벤트 정의, 이벤트 스토어 설계, 이벤트 핸들러 구현 및 골재 상태를 재구성합니다. 모범 사례, 일반적인 함정 및 유용한 도서관 (prooph,

이 기사에서는 SQL 주입, XSS, CSRF, 세션 납치, 파일 포함 및 RCE를 포함한 일반적인 PHP 8 보안 취약점을 검토합니다. 입력 유효성 검사, 출력 인코딩, 보안 세션 관리 및 정기와 같은 모범 사례를 강조합니다.

이 기사는 PHP 8 모범 사례에 대한 업데이트를 유지하는 방법에 대해 자세히 설명합니다. 블로그, 온라인 커뮤니티, 컨퍼런스 및 공식 문서와 같은 리소스와 일관된 참여를 강조합니다. KEY PHP 8 Union 유형, 인수, 인수,

이 기사는 PHP 8의 효율적인 배열 처리를 탐구합니다. 적절한 기능 (예 : Array_Map), 데이터 구조 (예 : SplfixedArray) 사용을 포함하여 배열 작업을 최적화하는 기술을 검사합니다.

이 기사는 날짜/시간 조작을위한 PHP 8의 DateTime 클래스를 자세히 설명합니다. 핵심 기능, 개선 된 오류 처리, 노조 유형 및 속성을 다룹니다. 효율적인 계산, 시간대 취급 및 국제화를위한 모범 사례 a

이 기사에서는 PHP 8 프로젝트에서 정적 분석에 PHPSTAN을 사용하는 방법을 설명합니다. 설치, 명령 줄 사용 및 PHPSTAN.NEON 구성, 분석 레벨 사용자 정의, 경로 제외 및 규칙 관리에 대한 자세한 내용. 혜택에는 포함됩니다

이 기사는 PHP 8에서 효과적인 PHPUnit 단위 테스트를 작성하기위한 모범 사례를 자세히 설명합니다. PHP 8 기능을 활용하고 오버 모킹 및 모킹 및 모킹 및 모킹과 같은 일반적인 함정을 피하기 위해 독립성, 원자력 및 속도와 같은 원칙을 강조합니다.


핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

PhpStorm 맥 버전
최신(2018.2.1) 전문 PHP 통합 개발 도구

Atom Editor Mac 버전 다운로드
가장 인기 있는 오픈 소스 편집기

mPDF
mPDF는 UTF-8로 인코딩된 HTML에서 PDF 파일을 생성할 수 있는 PHP 라이브러리입니다. 원저자인 Ian Back은 자신의 웹 사이트에서 "즉시" PDF 파일을 출력하고 다양한 언어를 처리하기 위해 mPDF를 작성했습니다. HTML2FPDF와 같은 원본 스크립트보다 유니코드 글꼴을 사용할 때 속도가 느리고 더 큰 파일을 생성하지만 CSS 스타일 등을 지원하고 많은 개선 사항이 있습니다. RTL(아랍어, 히브리어), CJK(중국어, 일본어, 한국어)를 포함한 거의 모든 언어를 지원합니다. 중첩된 블록 수준 요소(예: P, DIV)를 지원합니다.

Dreamweaver Mac版
시각적 웹 개발 도구

뜨거운 주제



