您好,登錄后才能下訂單哦!
這篇文章主要介紹如何安裝php(centos8),文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!
本文只考慮centos8
remi是一個php安裝倉庫。是rpm包。
用了國內鏡像會速度極快,下載包的速度:3MB/秒,驚人的快!
無論docker還是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
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
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
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
體驗到快如閃電的速度了吧!
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/
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)的所有內容,感謝各位的閱讀!希望分享的內容對大家有幫助,更多相關知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。