최대한 빨리 PHP(centos8)를 설치하세요!

藏色散人
풀어 주다: 2023-04-09 16:30:01
앞으로
4487명이 탐색했습니다.

推荐:《PHP视频教程

快如闪电的安装php(centos8)

本文只考虑centos8

remi是一个php安装仓库。是rpm包。

用了国内镜像会速度极快,下载包的速度:3MB/秒,惊人的快!

无论docker还是centos环境都非常的快!!

首先,安装阿里的 centos 仓库。

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.reporm -f  /etc/yum.repos.d/CentOS-centosplus.reporm -f  /etc/yum.repos.d/CentOS-PowerTools.reporm -f  /etc/yum.repos.d/CentOS-Extras.reporm -f  /etc/yum.repos.d/CentOS-AppStream.repo
dnf makecache
dnf repolist
로그인 후 복사

安装阿里的 epel 仓库。

dnf install -y epel-releasesed -i 's|^#baseurl=https://download.fedoraproject.org/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
dnf makecache
dnf repolist
로그인 후 복사

安装阿里的 remi 的仓库

dnf install -y https://mirrors.aliyun.com/remi/enterprise/remi-release-8.rpmsed -i  's/https*:\/\/rpms.remirepo.net/https:\/\/mirrors.aliyun.com\/remi/g'  /etc/yum.repos.d/remi*sed -i 's/#baseurl/baseurl/g' /etc/yum.repos.d/remi*
로그인 후 복사

快如闪电的最关键是下一句,清除镜像列表!!否则又去读取国外的镜像了。

sed -i 's|^mirrorlist|#mirrorlist|' /etc/yum.repos.d/remi*

dnf makecache
dnf repolist
로그인 후 복사

安装 php

dnf install -y yum-utils

dnf install -y php74 php74-php-devel  php74-php-fpm  php74-php-mbstring php74-php-memcache php74-php-memcached php74-php-redis  php74-php-mysqlnd  php74-php-pdo  php74-php-bcmath php74-php-xml php74-php-gd php74-php-gmp php74-php-igbinary php74-php-imagick   php74-php-mcrypt  php74-php-pdo_mysql php74-php-posix php74-php-simplexml  php74-php-opcache php74-php-xsl php74-php-xmlwriter php74-php-xmlreader php74-php-swoole php74-php-zip php74-php-phalcon  php74-php-yaml php74-php-yar php74-php-yaf php74-php-uuid
로그인 후 복사

体验到快如闪电的速度了吧!

最后安装阿里的 composer 镜像源

ln -s /usr/bin/php74 /usr/bin/phpcurl -o /usr/local/bin/composer https://mirrors.aliyun.com/composer/composer.pharchmod +x /usr/local/bin/composer
로그인 후 복사

注意观察,确认安装成功,且大版本是2.0

composer -V
로그인 후 복사

立刻设置composer 的镜像源为阿里

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
로그인 후 복사

安装 nginx

cat>/etc/yum.repos.d/nginx.repo<<EOF
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/\$releasever/\$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
EOFdnf install -y nginx
nginx -v
systemctl enable nginx
로그인 후 복사

위 내용은 최대한 빨리 PHP(centos8)를 설치하세요!의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

관련 라벨:
원천:learnku.com
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!