PHP學習-5 安裝PHP

1 PHP快速安裝

  • PHP源添加
    使用YUM快速安裝php,首先需要添加兩個源庫文件。
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-8.rpm
Retrieving https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
warning: /var/tmp/rpm-tmp.AFqXwr: Header V3 RSA/SHA256 Signature, key ID 2f86d6a1: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:epel-release-8-7.el8             ################################# [100%]

Retrieving http://rpms.remirepo.net/enterprise/remi-release-8.rpm
warning: /var/tmp/rpm-tmp.IGwNHd: Header V4 RSA/SHA256 Signature, key ID 5f11735a: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:remi-release-8.1-2.el8.remi      ################################# [100%]
  • PHP查看
yum search php74*
================================================= Name & Summary Matched: php74* ==================================================
php74-php-pecl-psr-devel.x86_64 : php74-php-pecl-psr developer files (header)
php74-php-pecl-raphf-devel.x86_64 : php74-php-pecl-raphf developer files (header)
php74-php-pecl-propro-devel.x86_64 : php74-php-pecl-propro developer files (header)
php74-php-pecl-yaconf-devel.x86_64 : php74-php-pecl-yaconf developer files (header)
php74-php-pecl-xmldiff-devel.x86_64 : php74-php-pecl-xmldiff developer files (header)
php74-php-zephir-parser-devel.x86_64 : php74-php-zephir-parser developer files (headers)
php74-php-pecl-http-message-devel.x86_64 : php74-php-pecl-http-message developer files (headers)
====================================================== Name Matched: php74* =======================================================
php74.x86_64 : Package that installs PHP 7.4
php74-php.x86_64 : PHP scripting language for creating dynamic web sites
php74-build.x86_64 : Package shipping basic build configuration
php74-php-gd.x86_64 : A module for PHP applications for using the gd graphics library
php74-xhprof.noarch : A Hierarchical Profiler for PHP - Web interface
php74-zephir.noarch : Zephir language for creation of extensions for PHP.
php74-php-ast.x86_64 : Abstract Syntax Tree
php74-php-cli.x86_64 : Command-line interface for PHP
php74-php-dba.x86_64 : A database abstraction layer module for PHP applications
php74-php-dbg.x86_64 : The interactive PHP debugger
php74-php-ffi.x86_64 : Foreign Function Interface
php74-php-fpm.x86_64 : PHP FastCGI Process Manager
php74-php-gmp.x86_64 : A module for PHP applications for using the GNU MP library
php74-php-lz4.x86_64 : LZ4 Extension for PHP
php74-php-pdo.x86_64 : A database access abstraction module for PHP applications
php74-php-xml.x86_64 : A module for PHP applications which use XML
php74-runtime.x86_64 : Package that handles php74 Software Collection.
php74-php-imap.x86_64 : A module for PHP applications that use IMAP
php74-php-intl.x86_64 : Internationalization extension for PHP applications
php74-php-json.x86_64 : JavaScript Object Notation extension for PHP
php74-php-ldap.x86_64 : A module for PHP applications that use LDAP
php74-php-oci8.x86_64 : A module for PHP applications that use OCI8 databases
php74-php-odbc.x86_64 : A module for PHP applications that use ODBC databases
php74-php-pear.noarch : PHP Extension and Application Repository framework
php74-php-pggi.x86_64 : GTK bindings
php74-php-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices
php74-php-soap.x86_64 : A module for PHP applications that use the SOAP protocol
php74-php-tidy.x86_64 : Standard PHP module provides tidy library support
php74-php-zstd.x86_64 : Zstandard extension
php74-scldevel.x86_64 : Package shipping development files for php74
php74-unit-php.x86_64 : PHP module for NGINX Unit
php74-php-devel.x86_64 : Files needed for building PHP extensions
php74-php-pgsql.x86_64 : A PostgreSQL database module for PHP
php74-php-pinba.x86_64 : Client extension for Pinba statistics server
php74-php-bcmath.x86_64 : A module for PHP applications for using the bcmath library
php74-php-brotli.x86_64 : Brotli Extension for PHP
php74-php-common.x86_64 : Common files for PHP
php74-php-pspell.x86_64 : A module for PHP applications for using pspell interfaces
php74-php-snappy.x86_64 : Snappy Extension for PHP
php74-php-sodium.x86_64 : Wrapper for the Sodium cryptographic library
php74-php-sqlsrv.x86_64 : Microsoft Drivers for PHP for SQL Server
php74-php-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol
php74-php-enchant.x86_64 : Enchant spelling extension for PHP applications
php74-php-libvirt.x86_64 : PHP language binding for Libvirt
php74-php-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases
php74-php-opcache.x86_64 : The Zend OPcache
php74-php-pecl-ds.x86_64 : Data Structures for PHP
php74-php-pecl-ev.x86_64 : Provides interface to libev library
php74-php-pecl-pq.x86_64 : PostgreSQL client library (libpq) binding
php74-php-pecl-uv.x86_64 : Libuv wrapper
php74-php-process.x86_64 : Modules for PHP script using system process interfaces
php74-php-embedded.x86_64 : PHP library for embedding in applications
php74-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
php74-php-pecl-csv.x86_64 : CSV PHP extension
php74-php-pecl-dio.x86_64 : Direct I/O functions
php74-php-pecl-eio.x86_64 : Provides interface to the libeio library
php74-php-pecl-env.x86_64 : Load environment variables
php74-php-pecl-lua.x86_64 : Embedded lua interpreter
php74-php-pecl-lzf.x86_64 : Extension to handle LZF de/compression
php74-php-pecl-nsq.x86_64 : PHP extension for NSQ client
php74-php-pecl-psr.x86_64 : PSR interfaces
php74-php-pecl-rar.x86_64 : PHP extension for reading RAR archives
php74-php-pecl-rrd.x86_64 : PHP Bindings for rrdtool
php74-php-pecl-sdl.x86_64 : Simple DirectMedia Layer for PHP
php74-php-pecl-svn.x86_64 : PHP Bindings for the Subversion Revision control system
php74-php-pecl-vld.x86_64 : Dump the internal representation of PHP scripts
php74-php-pecl-yac.x86_64 : Lockless user data cache
php74-php-pecl-yaf.x86_64 : Yet Another Framework
php74-php-pecl-yar.x86_64 : Light, concurrent RPC framework
php74-php-pecl-yaz.x86_64 : Z39.50/SRU client
php74-php-pecl-zip.x86_64 : Une extension de gestion des ZIP
php74-php-pecl-zmq.x86_64 : ZeroMQ messaging
php74-php-phalcon4.x86_64 : Phalcon Framework
php74-php-componere.x86_64 : Composing PHP classes at runtime
php74-php-litespeed.x86_64 : LiteSpeed Web Server PHP support
php74-php-maxminddb.x86_64 : MaxMind DB Reader extension
php74-php-pdo-dblib.x86_64 : PDO driver for Microsoft SQL Server and Sybase databases
php74-php-pecl-amqp.x86_64 : Communicate with any AMQP compliant server
php74-php-pecl-apcu.x86_64 : APC User Cache
php74-php-pecl-apfd.x86_64 : Always Populate Form Data
php74-php-pecl-fann.x86_64 : Wrapper for FANN Library
php74-php-pecl-grpc.x86_64 : General RPC framework
php74-php-pecl-http.x86_64 : Extended HTTP support
php74-php-pecl-krb5.x86_64 : Kerberos authentification extension
php74-php-pecl-pcov.x86_64 : Code coverage driver
php74-php-pecl-ssh2.x86_64 : Bindings for the libssh2 library
php74-php-pecl-sync.x86_64 : Named and unnamed synchronization objects
php74-php-pecl-uopz.x86_64 : User Operations for Zend
php74-php-pecl-uuid.x86_64 : Universally Unique Identifier extension for PHP
php74-php-pecl-vips.x86_64 : PHP extension for interfacing with libvips
php74-php-pecl-wddx.x86_64 : Web Distributed Data Exchange
php74-php-pecl-yaml.x86_64 : PHP Bindings for yaml
php74-php-phpiredis.x86_64 : Client extension for Redis
php74-php-smbclient.x86_64 : PHP wrapper for libsmbclient
php74-php-wkhtmltox.x86_64 : HTML Converter
php74-php-pecl-cmark.x86_64 : CommonMark extension
php74-php-pecl-dbase.x86_64 : dBase database file access functions
php74-php-pecl-druid.x86_64 : A Druid driver for PHP
php74-php-pecl-event.x86_64 : Provides interface to libevent library
php74-php-pecl-geoip.x86_64 : Extension to map IP addresses to geographic places
php74-php-pecl-gnupg.x86_64 : Wrapper around the gpgme library
php74-php-pecl-mysql.x86_64 : MySQL database access functions
php74-php-pecl-oauth.x86_64 : PHP OAuth consumer extension
php74-php-pecl-parle.x86_64 : Parsing and lexing
php74-php-pecl-raphf.x86_64 : Resource and persistent handles factory
php74-php-pecl-solr2.x86_64 : API orientée objet pour Apache Solr
php74-php-pecl-stats.x86_64 : Routines for statistical computation
php74-php-pecl-stomp.x86_64 : Stomp client extension
php74-php-pecl-taint.x86_64 : XSS code sniffer
php74-php-pecl-xattr.x86_64 : Extended attributes
php74-php-pecl-xdiff.x86_64 : File differences/patches
php74-php-pecl-xxtea.x86_64 : XXTEA encryption algorithm extension for PHP
php74-php-libvirt-doc.noarch : Document of php-libvirt
php74-php-pecl-base58.x86_64 : Encode and decode data with base58
php74-php-pecl-bitset.x86_64 : BITSET library
php74-php-pecl-crypto.x86_64 : Wrapper for OpenSSL Crypto Library
php74-php-pecl-gender.x86_64 : Gender Extension
php74-php-pecl-hprose.x86_64 : Hprose for PHP
php74-php-pecl-hrtime.x86_64 : High resolution timing
php74-php-pecl-mcrypt.x86_64 : Bindings for the libmcrypt library
php74-php-pecl-pdflib.x86_64 : Package for generating PDF files
php74-php-pecl-propro.x86_64 : Property proxy
php74-php-pecl-radius.x86_64 : Radius client library
php74-php-pecl-recode.x86_64 : A module for PHP applications for using the recode library
php74-php-pecl-redis4.x86_64 : Extension for communicating with the Redis key-value store
php74-php-pecl-redis5.x86_64 : Extension for communicating with the Redis key-value store
php74-php-pecl-scrypt.x86_64 : Scrypt hashing function
php74-php-pecl-sphinx.x86_64 : PECL extension for Sphinx SQL full-text search engine
php74-php-pecl-ssdeep.x86_64 : Wrapper for libfuzzy library
php74-php-pecl-trader.x86_64 : Technical Analysis for traders
php74-php-pecl-xdebug.x86_64 : PECL package for debugging PHP scripts
php74-php-pecl-xhprof.x86_64 : PHP extension for XHProf, a Hierarchical Profiler
php74-php-pecl-yaconf.x86_64 : Yet Another Configurations Container
php74-php-pecl-apcu-bc.x86_64 : APCu Backwards Compatibility Module
php74-php-pecl-decimal.x86_64 : Arbitrary-precision floating-point decimal
php74-php-pecl-gearman.x86_64 : PHP wrapper to libgearman
php74-php-pecl-gmagick.x86_64 : Provides a wrapper to the GraphicsMagick library
php74-php-pecl-imagick.x86_64 : Extension to create and modify images using ImageMagick
php74-php-pecl-inotify.x86_64 : Inotify
php74-php-pecl-leveldb.x86_64 : LevelDB PHP bindings
php74-php-pecl-memprof.x86_64 : Memory usage profiler
php74-php-pecl-mongodb.x86_64 : MongoDB driver for PHP
php74-php-pecl-msgpack.x86_64 : API for communicating with MessagePack serialization
php74-php-pecl-rdkafka.x86_64 : Kafka client based on librdkafka
php74-php-pecl-rpminfo.x86_64 : RPM information
php74-php-pecl-runkit7.x86_64 : For all those things you... shouldn't have been doing anyway... but surely do!
php74-php-pecl-seaslog.x86_64 : An effective, fast, stable log extension for PHP
php74-php-pecl-selinux.x86_64 : SELinux binding for PHP scripting language
php74-php-pecl-swoole4.x86_64 : PHP's asynchronous concurrent distributed networking framework
php74-php-pecl-timecop.x86_64 : Time travel and freezing extension
php74-php-pecl-varnish.x86_64 : Varnish Cache bindings
php74-php-pecl-xmldiff.x86_64 : XML diff and merge
php74-php-pecl-igbinary.x86_64 : Replacement for the standard PHP serializer
php74-php-pecl-memcache.x86_64 : Extension to work with the Memcached caching daemon
php74-php-pecl-mogilefs.x86_64 : PHP client library to communicate with the MogileFS storage
php74-php-pecl-mustache.x86_64 : Mustache templating language
php74-php-pecl-protobuf.x86_64 : Mechanism for serializing structured data
php74-php-pecl-rdkafka4.x86_64 : Kafka client based on librdkafka
php74-php-pecl-scoutapm.x86_64 : Native Extension Component for ScoutAPM's PHP Agent
php74-php-pecl-translit.x86_64 : Transliterates non-latin character sets to latin
php74-php-snuffleupagus.x86_64 : Security module for PHP
php74-php-zephir-parser.x86_64 : Zephir parser extension
php74-php-ioncube-loader.x86_64 : Loader for ionCube Encoded Files with ionCube 24 support
php74-php-pecl-cassandra.x86_64 : DataStax PHP Driver for Apache Cassandra
php74-php-pecl-json-post.x86_64 : JSON POST handler
php74-php-pecl-mailparse.x86_64 : PHP PECL package for parsing and working with email messages
php74-php-pecl-memcached.x86_64 : Extension to work with the Memcached caching daemon
php74-php-pecl-mosquitto.x86_64 : Extension for libmosquitto
php74-php-pecl-seasclick.x86_64 : An Yandex ClickHouse client driven extension for PHP
php74-php-pecl-xlswriter.x86_64 : An efficient and fast xlsx file export extension
php74-php-horde-horde-lz4.x86_64 : Horde LZ4 Compression Extension
php74-php-pecl-apcu-devel.x86_64 : APCu developer files (header)
php74-php-pecl-couchbase2.x86_64 : Couchbase Server PHP extension
php74-php-pecl-geospatial.x86_64 : PHP Extension to handle common geospatial functions
php74-php-pecl-handlebars.x86_64 : Handlebars templating language
php74-php-pecl-http-devel.x86_64 : Extended HTTP support developer files (header)
php74-php-pecl-krb5-devel.x86_64 : Kerberos extension developer files (header)
php74-php-pecl-luasandbox.x86_64 : Lua interpreter with limits and safe environment
php74-php-pecl-opencensus.x86_64 : A stats collection and distributed tracing framework
php74-php-pecl-skywalking.x86_64 : The PHP instrument agent for Apache SkyWalking
php74-php-pecl-ahocorasick.x86_64 : Effective Aho-Corasick string pattern matching algorithm
php74-php-pecl-ip2location.x86_64 : Get geo location information of an IP address
php74-php-pecl-http-message.x86_64 : PSR-7 HTTP Message implementation
php74-php-pecl-datadog-trace.x86_64 : APM and distributed tracing for PHP
php74-php-pecl-hdr-histogram.x86_64 : PHP extension wrapper for the C hdrhistogram API
php74-php-pecl-imagick-devel.x86_64 : imagick extension developer files (header)
php74-php-pecl-msgpack-devel.x86_64 : MessagePack developer files (header)
php74-php-pecl-mysql-xdevapi.x86_64 : MySQL database access functions
php74-php-pecl-mysqlnd-azure.x86_64 : Redirection plugin for mysqlnd
php74-php-pecl-igbinary-devel.x86_64 : Igbinary developer files (header)
php74-php-pecl-uploadprogress.x86_64 : An extension to track progress of a file upload

追加了中文的說明

php74-php-snuffleupagus:x86_64: PHP的安全模塊
php74-php-pecl-cassandra:用於Apache的DataStax PHP驅動程序卡桑德拉
php74-php-pecl-nsq:NSQ客戶端的PHP擴展
php74-php-cli:用於PHP的命令行接口
php74-php-pecl-oauth:PHP OAuth消費者擴展
php74-php-pecl-decimal:任意精度浮點小數
php74-php-gmp:一個用於使用GNU的PHP應用程序模塊議員庫
php74-php-pecl-rdkafka4:基於librdkafka的Kafka客戶端
php74-php-soap:用於使用SOAP的PHP應用程序的模塊協議
php74-php-phpiredis:x86_64: Redis的客戶端擴展名
php74-php-pecl-taint:x86_64: XSS代碼嗅探器
php74-php-pecl-redis4:的擴展名 Redis鍵值存儲
php74-php-pecl-propro-devel:php74-php-pecl-propro developer files (header)
php74-php-pecl-psr-devel:php74-php-pecl-psr developer files (header)
php74-php-pecl-redis5:的擴展名 Redis鍵值存儲
php74-zephir:用於創建擴展的Zephir語言PHP
php74-php-pecl-selinux:用於PHP腳本的SELinux綁定語言
php74-php-pecl-rdkafka:基於librdkafka的Kafka客戶端
php74-php-pecl-grpc:x86_64:通用RPC框架
php74-php-brotli:用於PHP的Brotli擴展
php74-php-pecl-http-message-devel:php74-php-pecl-http-message developer files (headers)
php74-php-pecl-fann:用於FANN庫的包裝器
php74-php-pecl-yaz:x86_64: Z39.50/SRU客戶端
php74-php-lz4:x86_64: PHP的LZ4擴展
php74-php-libvirt:用於Libvirt的PHP語言綁定
php74-php-pecl-zmq:ZeroMQ消息傳遞
php74-php-pecl-mongodb:x86_64:用於PHP的MongoDB驅動程序
php74-php-process:用於PHP腳本的模塊使用系統進程接口
php74-php-zephir-parser-devel:php74-php-zephir-parser developer files (headers)
php74-php-pspell:x86_64:用於PHP應用程序的模塊中接口
php74-php-pecl-yar:輕量級併發RPC框架
php74-php:用於創建動態web的PHP腳本語言網站
php74-php-pecl-rrd:x86_64: rrdtool的PHP綁定
php74-runtime:處理php74軟件集合的包
php74-php-pecl-xmldiff-devel:php74-php-pecl-xmldiff developer files (header)
php74-php-pecl-hprose:用於PHP的h散文
php74-php-pecl-propro:屬性代理
php74-php-pecl-yac:無鎖用戶數據緩存
php74-php-pecl-csv:CSV PHP extension
php74-php-pecl-swoole4:PHP的異步併發分佈式網絡框架
php74-php-pecl-pcov:x86_64:代碼覆蓋驅動程序
php74-php-pecl-sync:已命名和未命名同步對象
php74-php-pecl-yaf:x86_64:又一個框架
php74-php-pecl-varnish:Varnish緩存綁定
php74-php-pggi:GTK綁定
php74-php-pecl-handlebars:Handlebars模板語言
php74-php-pecl-rar:用於讀取RAR存檔的PHP擴展
php74-php-pecl-xdebug:用於調試PHP腳本的PECL包
php74-php-oci8:x86_64:用於使用OCI8的PHP應用程序的模塊數據庫
php74-php-fpm:PHP FastCGI進程管理器
php74-php-common:PHP的公共文件
php74-php-pecl-xlswriter:一個高效、快速的xlsx文件出口擴展
php74-php-pecl-stats:用於統計計算的例程
php74-php-pecl-krb5:Kerberos驗證擴展
php74-php-pecl-xhprof:x86_64: XHProf的PHP擴展,層次結構分析器
php74-php-pecl-ssdeep:libfuzzy庫的包裝器
php74-php-pecl-imagick:x86_64:用於創建和修改映像的擴展使用ImageMagick
php74-php-pecl-apcu-bc:APCu向後兼容模塊
php74-php-xml:x86_64:用於使用XML的PHP應用程序的模塊
php74-php-sodium:x86_64:鈉密碼庫的包裝
php74-php-pecl-apfd:總是填充表單數據
php74-php-componere:在運行時編寫PHP類
php74-php-pecl-cmark:CommonMark擴展名
php74-php-pecl-uploadprogress:x86_64:跟蹤進度的擴展文件上傳
php74-php-pecl-apcu-devel:APCu開發人員文件(頭文件)
php74-php-devel:構建PHP擴展所需的文件
php74-php-pecl-http-message:x86_64: PSR-7 HTTP消息實現
php74-xhprof:一個用於PHP - Web接口的層次分析器
php74-php-pear:noarch: PHP擴展和應用程序庫框架
php74-php-pecl-igbinary:x86_64:替代標準PHP序列化器
php74-php-pecl-sdl:簡單的PHP DirectMedia層
php74-php-pecl-parle:x86_64:解析和詞法分析
php74-php-pecl-zip:一個ZIP文件的擴展名
php74:安裝PHP 7.4的包
php74-php-pecl-memcached:x86_64:使用Memcached的擴展緩存守護進程
php74-php-zstd:x86_64: Zstandard擴展名
php74-php-pecl-json-post:JSON POST處理程序
php74-php-pecl-couchbase2:Couchbase服務器PHP擴展
php74-php-pecl-krb5-devel:Kerberos擴展開發人員文件(頭)
php74-php-pecl-memcache:x86_64:使用Memcached的擴展緩存守護進程
php74-php-pecl-xattr:擴展屬性
php74-php-pecl-svn:x86_64: Subversion版本的PHP綁定控制系統
php74-php-pecl-seaslog:一個有效、快速、穩定的日誌 PHP擴展
php74-php-pecl-protobuf:序列化結構化的機制數據
php74-php-enchant:增強PHP的拼寫擴展應用程序
php74-php-pecl-mogilefs:要與之通信的PHP客戶端庫 MogileFS存儲
php74-php-phalcon4:Phalcon框架
php74-php-pecl-xmldiff:x86_64: XML差異和合並
php74-php-pecl-trader:爲貿易商提供技術分析
php74-php-litespeed:LiteSpeed Web服務器PHP支持
php74-php-pecl-rpminfo:x86_64: RPM信息
php74-php-pecl-uopz:x86_64: Zend的用戶操作
php74-php-pecl-gnupg:x86_64: gpgme庫的包裝
php74-php-pecl-vld:x86_64:轉儲PHP的內部表示腳本
php74-php-pecl-apcu:APC用戶緩存
php74-php-maxminddb:MaxMind DB Reader擴展
php74-php-embedded:用於嵌入應用程序的PHP庫
php74-php-pecl-wddx:Web分佈式數據交換
php74-php-pecl-seasclick:一個Yandex ClickHouse客戶端驅動 PHP擴展
php74-php-pecl-ip2location:獲取an的地理位置信息IP地址
php74-php-pecl-xdiff:文件差異/補丁
php74-php-pecl-psr:PSR接口
php74-build:基本的構建配置
php74-php-pgsql:一個用於PHP的PostgreSQL數據庫模塊
php74-php-json:x86_64: PHP的JavaScript對象符號擴展
php74-php-pecl-yaconf-devel:php74-php-pecl-yaconf developer files (header)
php74-php-pecl-scoutapm:本地擴展組件 ScoutAPM的PHP代理
php74-php-pecl-druid:一個PHP的德魯伊驅動
php74-php-mysqlnd:x86_64:用於使用MySQL的PHP應用程序的模塊數據庫
php74-php-pecl-xxtea:XXTEA加密算法擴展PHP
php74-php-smbclient:libsmbclient的PHP包裝
php74-php-pecl-mysql:MySQL數據庫訪問函數
php74-php-pecl-http:擴展的HTTP支持
php74-php-pecl-recode:A module for PHP applications for using the recode library
php74-php-odbc:x86_64:用於使用ODBC的PHP應用程序的模塊數據庫
php74-php-tidy:標準PHP模塊提供了tidy庫支持
php74-php-xmlrpc:的PHP應用程序模塊xml - rpc協議
php74-php-gd:用於PHP應用程序使用gd的模塊圖形庫
php74-php-pecl-uuid:通用唯一標識符擴展對於PHP
php74-php-pecl-lua:嵌入式lua解釋器
php74-php-intl:x86_64: PHP國際化擴展應用程序
php74-php-pecl-datadog-trace:APM和分佈式跟蹤PHP
php74-php-ffi:外部函數接口
php74-php-pecl-timecop:x86_64:時間旅行和凍結擴展
php74-php-pecl-mailparse:用於解析和的PHP PECL包處理電子郵件消息
php74-php-pecl-skywalking:x86_64: Apache的PHP工具代理人行天橋
php74-php-sqlsrv:x86_64:用於SQL Server的PHP Microsoft驅動程序
php74-php-pecl-memprof:x86_64:內存使用分析器
php74-php-zephir-parser:x86_64: Zephir解析器擴展
php74-php-bcmath:用於PHP應用程序的模塊bcmath庫
php74-php-pecl-runkit7:爲了這些你…不應該…無論如何我一直在做……但是肯定做的!
php74-scldevel:x86_64:打包php74的開發文件
php74-php-pecl-geoip:將IP地址映射到的擴展名地理位置
php74-php-pinba:x86_64: Pinba統計服務器的客戶端擴展
php74-php-pecl-dbase:dBase數據庫文件訪問函數
php74-php-pecl-ssh2:x86_64: libssh2庫的綁定
php74-php-pecl-pq:PostgreSQL客戶端庫(libpq)綁定
php74-php-pecl-pdflib:生成PDF文件的包
php74-php-pecl-radius:Radius客戶端庫
php74-php-pecl-eio:提供libeio庫的接口
php74-php-pecl-sphinx:Sphinx SQL全文的PECL擴展搜索引擎
php74-php-pecl-mustache:Mustache模板語言
php74-php-pecl-yaconf:x86_64:另一個配置容器
php74-php-ast:抽象語法樹
php74-php-pecl-gearman:PHP包裝器到libgearman
php74-php-pecl-hdr-histogram:x86_64: C語言的PHP擴展包裝hdrhistogram API
php74-php-pdo-dblib:x86_64: PDO驅動程序,用於Microsoft SQL Server和Sybase數據庫
php74-php-pecl-scrypt:Scrypt散列函數
php74-php-pecl-ahocorasick:有效的Aho-Corasick字符串模式匹配算法
php74-php-pecl-raphf-devel:php74-php-pecl-raphf developer files (header)
php74-php-pecl-bitset:位集庫
php74-php-pecl-mcrypt:x86_64: libmcrypt庫的綁定
php74-php-mbstring:一個用於PHP應用程序的模塊多字節字符串處理
php74-php-pdo:一個用於PHP的數據庫訪問抽象模塊應用程序
php74-php-pecl-gmagick:的包裝器GraphicsMagick庫
php74-php-pecl-amqp:與任何AMQP兼容的服務器通信
php74-php-libvirt-doc:noarch: php-libvirt文件
php74-php-pecl-mosquitto:libmosquito - to的擴展
php74-php-pecl-leveldb:LevelDB PHP綁定
php74-php-pecl-lzf:x86_64:處理LZF de/壓縮的擴展
php74-php-pecl-base58:用base58編碼和解碼數據
php74-php-pecl-inotify:x86_64: Inotify
php74-php-pecl-crypto:OpenSSL密碼庫的包裝器
php74-php-imap:x86_64:用於使用IMAP的PHP應用程序的模塊
php74-php-pecl-yaml:x86_64: yaml的PHP綁定
php74-php-pecl-imagick-devel:imagick擴展開發人員文件(頭)
php74-php-pecl-solr2:Apache Solr的API定向對象
php74-php-horde-horde-lz4:Horde LZ4壓縮擴展
php74-php-ioncube-loader:Loader for ionCube Encoded Files with ionCube 24 support
php74-php-snappy:PHP的Snappy擴展
php74-php-pecl-hrtime:x86_64:高分辨率定時
php74-php-pecl-raphf:資源和持久句柄工廠
php74-php-pecl-http-devel:x86_64:擴展HTTP支持開發人員文件(頭)
php74-php-pecl-stomp:Stomp客戶端擴展
php74-php-pecl-uv:Libuv包裝器
php74-php-pecl-luasandbox:帶有限制和安全的Lua解釋器環境
php74-php-pecl-msgpack:用於與MessagePack通信的API序列化
php74-php-pecl-mysql-xdevapi:MySQL數據庫訪問函數
php74-php-pecl-event:提供libevent庫的接口
php74-php-dbg:交互式PHP調試器
php74-php-pecl-msgpack-devel:MessagePack開發人員文件(頭)
php74-php-pecl-env:加載環境變量
php74-php-pecl-ds:x86_64: PHP的數據結構
php74-php-dba:一個用於PHP的數據庫抽象層模塊應用程序
php74-php-pecl-gender:x86_64:性別擴展
php74-php-pecl-translit:將非拉丁字符音譯設置爲拉丁文
php74-php-wkhtmltox:HTML轉換器
php74-php-pecl-vips:x86_64:與libvip接口的PHP擴展
php74-unit-php:用於NGINX單元的PHP模塊
php74-php-pecl-opencensus:一個stats集合和分佈式跟蹤框架
php74-php-snmp:一個用於PHP應用程序查詢的模塊SNMP-managed設備
php74-php-ldap:x86_64:用於使用LDAP的PHP應用程序的模塊
php74-php-opcache:x86_64: Zend OPcache
php74-php-pecl-mysqlnd-azure:x86_64: mysqlnd的重定向插件
php74-php-pecl-dio:直接I/O函數
php74-php-pecl-geospatial:PHP擴展來處理公共地理空間功能
php74-php-pecl-ev:提供libev庫的接口
php74-php-pecl-igbinary-devel:Igbinary開發人員文件(頭)
  • 安裝PHP
yum -y install php74 php74-php
Last metadata expiration check: 0:15:33 ago on Thu 12 Mar 2020 09:57:52 AM EDT.
Dependencies resolved.
===================================================================================================================================
 Package                         Architecture       Version                                            Repository             Size
===================================================================================================================================
Installing:
 php74                           x86_64             1.0-1.el8.remi                                     remi-safe             6.6 k
 php74-php                       x86_64             7.4.3-1.el8.remi                                   remi-safe             1.5 M
Installing dependencies:
 apr                             x86_64             1.6.3-9.el8                                        AppStream             125 k
 apr-util                        x86_64             1.6.1-6.el8                                        AppStream             105 k
 centos-logos-httpd              noarch             80.5-2.el8                                         AppStream              24 k
 httpd                           x86_64             2.4.37-16.module_el8.1.0+256+ae790463              AppStream             1.7 M
 httpd-filesystem                noarch             2.4.37-16.module_el8.1.0+256+ae790463              AppStream              35 k
 httpd-tools                     x86_64             2.4.37-16.module_el8.1.0+256+ae790463              AppStream             103 k
 mod_http2                       x86_64             1.11.3-3.module_el8.1.0+213+acce2796               AppStream             158 k
 oniguruma                       x86_64             6.8.2-1.el8                                        AppStream             188 k
 scl-utils                       x86_64             1:2.0.2-11.el8                                     AppStream              47 k
 environment-modules             x86_64             4.1.4-4.el8                                        BaseOS                254 k
 tcl                             x86_64             1:8.6.8-2.el8                                      BaseOS                1.1 M
 libsodium                       x86_64             1.0.18-2.el8                                       epel                  162 k
 php74-php-cli                   x86_64             7.4.3-1.el8.remi                                   remi-safe             3.1 M
 php74-php-common                x86_64             7.4.3-1.el8.remi                                   remi-safe             697 k
 php74-php-json                  x86_64             7.4.3-1.el8.remi                                   remi-safe              77 k
 php74-runtime                   x86_64             1.0-1.el8.remi                                     remi-safe             1.1 M
Installing weak dependencies:
 apr-util-bdb                    x86_64             1.6.1-6.el8                                        AppStream              25 k
 apr-util-openssl                x86_64             1.6.1-6.el8                                        AppStream              27 k
 php74-php-fpm                   x86_64             7.4.3-1.el8.remi                                   remi-safe             1.6 M
 php74-php-mbstring              x86_64             7.4.3-1.el8.remi                                   remi-safe             488 k
 php74-php-opcache               x86_64             7.4.3-1.el8.remi                                   remi-safe             270 k
 php74-php-pdo                   x86_64             7.4.3-1.el8.remi                                   remi-safe             126 k
 php74-php-sodium                x86_64             7.4.3-1.el8.remi                                   remi-safe              83 k
 php74-php-xml                   x86_64             7.4.3-1.el8.remi                                   remi-safe             178 k

Transaction Summary
===================================================================================================================================
Install  26 Packages

Total download size: 13 M
Installed size: 49 M
Downloading Packages:
(1/26): apr-util-1.6.1-6.el8.x86_64.rpm                                                            198 kB/s | 105 kB     00:00
(2/26): apr-util-openssl-1.6.1-6.el8.x86_64.rpm                                                    466 kB/s |  27 kB     00:00
(3/26): centos-logos-httpd-80.5-2.el8.noarch.rpm                                                    62 kB/s |  24 kB     00:00
(4/26): apr-util-bdb-1.6.1-6.el8.x86_64.rpm                                                         24 kB/s |  25 kB     00:01
(5/26): apr-1.6.3-9.el8.x86_64.rpm                                                                 100 kB/s | 125 kB     00:01
(6/26): httpd-filesystem-2.4.37-16.module_el8.1.0+256+ae790463.noarch.rpm                          113 kB/s |  35 kB     00:00
(7/26): httpd-tools-2.4.37-16.module_el8.1.0+256+ae790463.x86_64.rpm                                69 kB/s | 103 kB     00:01
(8/26): oniguruma-6.8.2-1.el8.x86_64.rpm                                                           1.3 MB/s | 188 kB     00:00
(9/26): mod_http2-1.11.3-3.module_el8.1.0+213+acce2796.x86_64.rpm                                  100 kB/s | 158 kB     00:01
(10/26): scl-utils-2.0.2-11.el8.x86_64.rpm                                                         608 kB/s |  47 kB     00:00
(11/26): environment-modules-4.1.4-4.el8.x86_64.rpm                                                630 kB/s | 254 kB     00:00
(12/26): libsodium-1.0.18-2.el8.x86_64.rpm                                                         438 kB/s | 162 kB     00:00
(13/26): tcl-8.6.8-2.el8.x86_64.rpm                                                                1.1 MB/s | 1.1 MB     00:00
(14/26): php74-1.0-1.el8.remi.x86_64.rpm                                                           6.6 kB/s | 6.6 kB     00:00
(15/26): httpd-2.4.37-16.module_el8.1.0+256+ae790463.x86_64.rpm                                    152 kB/s | 1.7 MB     00:11
(16/26): php74-php-common-7.4.3-1.el8.remi.x86_64.rpm                                               24 kB/s | 697 kB     00:29
(17/26): php74-php-7.4.3-1.el8.remi.x86_64.rpm                                                      41 kB/s | 1.5 MB     00:38
(18/26): php74-php-json-7.4.3-1.el8.remi.x86_64.rpm                                                 45 kB/s |  77 kB     00:01
(19/26): php74-php-mbstring-7.4.3-1.el8.remi.x86_64.rpm                                             13 kB/s | 488 kB     00:36
(20/26): php74-php-fpm-7.4.3-1.el8.remi.x86_64.rpm                                                  30 kB/s | 1.6 MB     00:54
(21/26): php74-php-pdo-7.4.3-1.el8.remi.x86_64.rpm                                                  57 kB/s | 126 kB     00:02
(22/26): php74-php-sodium-7.4.3-1.el8.remi.x86_64.rpm                                               49 kB/s |  83 kB     00:01
(23/26): php74-php-xml-7.4.3-1.el8.remi.x86_64.rpm                                                  33 kB/s | 178 kB     00:05
(24/26): php74-php-cli-7.4.3-1.el8.remi.x86_64.rpm                                                  30 kB/s | 3.1 MB     01:46
(25/26): php74-php-opcache-7.4.3-1.el8.remi.x86_64.rpm                                             6.3 kB/s | 270 kB     00:43
(26/26): php74-runtime-1.0-1.el8.remi.x86_64.rpm                                                    27 kB/s | 1.1 MB     00:43
-----------------------------------------------------------------------------------------------------------------------------------
Total                                                                                               85 kB/s |  13 MB     02:38
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                           1/1
  Running scriptlet: httpd-filesystem-2.4.37-16.module_el8.1.0+256+ae790463.noarch                                            1/26
  Installing       : httpd-filesystem-2.4.37-16.module_el8.1.0+256+ae790463.noarch                                            1/26
  Installing       : apr-1.6.3-9.el8.x86_64                                                                                   2/26
  Running scriptlet: apr-1.6.3-9.el8.x86_64                                                                                   2/26
  Installing       : apr-util-bdb-1.6.1-6.el8.x86_64                                                                          3/26
  Installing       : apr-util-openssl-1.6.1-6.el8.x86_64                                                                      4/26
  Installing       : apr-util-1.6.1-6.el8.x86_64                                                                              5/26
  Running scriptlet: apr-util-1.6.1-6.el8.x86_64                                                                              5/26
  Installing       : httpd-tools-2.4.37-16.module_el8.1.0+256+ae790463.x86_64                                                 6/26
  Installing       : libsodium-1.0.18-2.el8.x86_64                                                                            7/26
  Installing       : tcl-1:8.6.8-2.el8.x86_64                                                                                 8/26
  Running scriptlet: tcl-1:8.6.8-2.el8.x86_64                                                                                 8/26
  Installing       : environment-modules-4.1.4-4.el8.x86_64                                                                   9/26
  Running scriptlet: environment-modules-4.1.4-4.el8.x86_64                                                                   9/26
  Installing       : scl-utils-1:2.0.2-11.el8.x86_64                                                                         10/26
  Installing       : php74-runtime-1.0-1.el8.remi.x86_64                                                                     11/26
  Running scriptlet: php74-runtime-1.0-1.el8.remi.x86_64                                                                     11/26
  Installing       : php74-php-json-7.4.3-1.el8.remi.x86_64                                                                  12/26
  Installing       : php74-php-common-7.4.3-1.el8.remi.x86_64                                                                13/26
  Installing       : php74-php-cli-7.4.3-1.el8.remi.x86_64                                                                   14/26
  Installing       : php74-php-fpm-7.4.3-1.el8.remi.x86_64                                                                   15/26
  Running scriptlet: php74-php-fpm-7.4.3-1.el8.remi.x86_64                                                                   15/26
  Installing       : php74-php-opcache-7.4.3-1.el8.remi.x86_64                                                               16/26
  Installing       : php74-php-pdo-7.4.3-1.el8.remi.x86_64                                                                   17/26
  Installing       : php74-php-sodium-7.4.3-1.el8.remi.x86_64                                                                18/26
  Installing       : php74-php-xml-7.4.3-1.el8.remi.x86_64                                                                   19/26
  Installing       : oniguruma-6.8.2-1.el8.x86_64                                                                            20/26
  Running scriptlet: oniguruma-6.8.2-1.el8.x86_64                                                                            20/26
  Installing       : php74-php-mbstring-7.4.3-1.el8.remi.x86_64                                                              21/26
  Installing       : centos-logos-httpd-80.5-2.el8.noarch                                                                    22/26
  Installing       : mod_http2-1.11.3-3.module_el8.1.0+213+acce2796.x86_64                                                   23/26
  Installing       : httpd-2.4.37-16.module_el8.1.0+256+ae790463.x86_64                                                      24/26
  Running scriptlet: httpd-2.4.37-16.module_el8.1.0+256+ae790463.x86_64                                                      24/26
  Installing       : php74-php-7.4.3-1.el8.remi.x86_64                                                                       25/26
  Installing       : php74-1.0-1.el8.remi.x86_64                                                                             26/26
  Running scriptlet: httpd-2.4.37-16.module_el8.1.0+256+ae790463.x86_64                                                      26/26
  Running scriptlet: php74-1.0-1.el8.remi.x86_64                                                                             26/26
  Running scriptlet: php74-php-fpm-7.4.3-1.el8.remi.x86_64                                                                   26/26
  Verifying        : apr-1.6.3-9.el8.x86_64                                                                                   1/26
  Verifying        : apr-util-1.6.1-6.el8.x86_64                                                                              2/26
  Verifying        : apr-util-bdb-1.6.1-6.el8.x86_64                                                                          3/26
  Verifying        : apr-util-openssl-1.6.1-6.el8.x86_64                                                                      4/26
  Verifying        : centos-logos-httpd-80.5-2.el8.noarch                                                                     5/26
  Verifying        : httpd-2.4.37-16.module_el8.1.0+256+ae790463.x86_64                                                       6/26
  Verifying        : httpd-filesystem-2.4.37-16.module_el8.1.0+256+ae790463.noarch                                            7/26
  Verifying        : httpd-tools-2.4.37-16.module_el8.1.0+256+ae790463.x86_64                                                 8/26
  Verifying        : mod_http2-1.11.3-3.module_el8.1.0+213+acce2796.x86_64                                                    9/26
  Verifying        : oniguruma-6.8.2-1.el8.x86_64                                                                            10/26
  Verifying        : scl-utils-1:2.0.2-11.el8.x86_64                                                                         11/26
  Verifying        : environment-modules-4.1.4-4.el8.x86_64                                                                  12/26
  Verifying        : tcl-1:8.6.8-2.el8.x86_64                                                                                13/26
  Verifying        : libsodium-1.0.18-2.el8.x86_64                                                                           14/26
  Verifying        : php74-1.0-1.el8.remi.x86_64                                                                             15/26
  Verifying        : php74-php-7.4.3-1.el8.remi.x86_64                                                                       16/26
  Verifying        : php74-php-cli-7.4.3-1.el8.remi.x86_64                                                                   17/26
  Verifying        : php74-php-common-7.4.3-1.el8.remi.x86_64                                                                18/26
  Verifying        : php74-php-fpm-7.4.3-1.el8.remi.x86_64                                                                   19/26
  Verifying        : php74-php-json-7.4.3-1.el8.remi.x86_64                                                                  20/26
  Verifying        : php74-php-mbstring-7.4.3-1.el8.remi.x86_64                                                              21/26
  Verifying        : php74-php-opcache-7.4.3-1.el8.remi.x86_64                                                               22/26
  Verifying        : php74-php-pdo-7.4.3-1.el8.remi.x86_64                                                                   23/26
  Verifying        : php74-php-sodium-7.4.3-1.el8.remi.x86_64                                                                24/26
  Verifying        : php74-php-xml-7.4.3-1.el8.remi.x86_64                                                                   25/26
  Verifying        : php74-runtime-1.0-1.el8.remi.x86_64                                                                     26/26

Installed:
  php74-1.0-1.el8.remi.x86_64                                        php74-php-7.4.3-1.el8.remi.x86_64
  apr-util-bdb-1.6.1-6.el8.x86_64                                    apr-util-openssl-1.6.1-6.el8.x86_64
  php74-php-fpm-7.4.3-1.el8.remi.x86_64                              php74-php-mbstring-7.4.3-1.el8.remi.x86_64
  php74-php-opcache-7.4.3-1.el8.remi.x86_64                          php74-php-pdo-7.4.3-1.el8.remi.x86_64
  php74-php-sodium-7.4.3-1.el8.remi.x86_64                           php74-php-xml-7.4.3-1.el8.remi.x86_64
  apr-1.6.3-9.el8.x86_64                                             apr-util-1.6.1-6.el8.x86_64
  centos-logos-httpd-80.5-2.el8.noarch                               httpd-2.4.37-16.module_el8.1.0+256+ae790463.x86_64
  httpd-filesystem-2.4.37-16.module_el8.1.0+256+ae790463.noarch      httpd-tools-2.4.37-16.module_el8.1.0+256+ae790463.x86_64
  mod_http2-1.11.3-3.module_el8.1.0+213+acce2796.x86_64              oniguruma-6.8.2-1.el8.x86_64
  scl-utils-1:2.0.2-11.el8.x86_64                                    environment-modules-4.1.4-4.el8.x86_64
  tcl-1:8.6.8-2.el8.x86_64                                           libsodium-1.0.18-2.el8.x86_64
  php74-php-cli-7.4.3-1.el8.remi.x86_64                              php74-php-common-7.4.3-1.el8.remi.x86_64
  php74-php-json-7.4.3-1.el8.remi.x86_64                             php74-runtime-1.0-1.el8.remi.x86_64

Complete!

  • 已安裝PHP查看
yum list installed | grep 'php74'
php74.x86_64                          1.0-1.el8.remi                                    @remi-safe
php74-php.x86_64                      7.4.3-1.el8.remi                                  @remi-safe
php74-php-cli.x86_64                  7.4.3-1.el8.remi                                  @remi-safe
php74-php-common.x86_64               7.4.3-1.el8.remi                                  @remi-safe
php74-php-fpm.x86_64                  7.4.3-1.el8.remi                                  @remi-safe
php74-php-json.x86_64                 7.4.3-1.el8.remi                                  @remi-safe
php74-php-mbstring.x86_64             7.4.3-1.el8.remi                                  @remi-safe
php74-php-opcache.x86_64              7.4.3-1.el8.remi                                  @remi-safe
php74-php-pdo.x86_64                  7.4.3-1.el8.remi                                  @remi-safe
php74-php-sodium.x86_64               7.4.3-1.el8.remi                                  @remi-safe
php74-php-xml.x86_64                  7.4.3-1.el8.remi                                  @remi-safe
php74-runtime.x86_64                  1.0-1.el8.remi                                    @remi-safe
  • PHP其他安裝包
    上面已經給出了可使用yum search php74*查看可用安裝包,可以使用yum -y install php74-XXX安裝其他安裝包。

2 啓動PHP

  • PHP運行狀態查看
systemctl status php74-php-fpm.service
● php74-php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php74-php-fpm.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

Mar 12 10:43:49 localhost.localdomain systemd[1]: Starting The PHP FastCGI Process Manager...
Mar 12 10:43:49 localhost.localdomain systemd[1]: Started The PHP FastCGI Process Manager.
Mar 12 10:44:01 localhost.localdomain systemd[1]: Stopping The PHP FastCGI Process Manager...
Mar 12 10:44:01 localhost.localdomain systemd[1]: Stopped The PHP FastCGI Process Manager.
  • PHP啓動
systemctl start php74-php-fpm.service
● php74-php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php74-php-fpm.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2020-03-12 10:53:03 EDT; 1s ago
 Main PID: 5016 (php-fpm)
   Status: "Ready to handle connections"
    Tasks: 6 (limit: 11497)
   Memory: 22.6M
   CGroup: /system.slice/php74-php-fpm.service
           ├─5016 php-fpm: master process (/etc/opt/remi/php74/php-fpm.conf)
           ├─5017 php-fpm: pool www
           ├─5018 php-fpm: pool www
           ├─5019 php-fpm: pool www
           ├─5020 php-fpm: pool www
           └─5021 php-fpm: pool www

Mar 12 10:53:03 localhost.localdomain systemd[1]: Starting The PHP FastCGI Process Manager...
Mar 12 10:53:03 localhost.localdomain systemd[1]: Started The PHP FastCGI Process Manager.
  • 添加開機自啓動
systemctl enable php74-php-fpm.service
systemctl daemon-reload
Created symlink /etc/systemd/system/multi-user.target.wants/php74-php-fpm.service → /usr/lib/systemd/system/php74-php-fpm.service.
  • 移除開機自啓動
systemctl disable php74-php-fpm.service
systemctl daemon-reload
Removed /etc/systemd/system/multi-user.target.wants/php74-php-fpm.service.

3 其他

  • PHP搭建環境的坑
    在這裏插入圖片描述
    PHP運行環境搭建完成之後訪問總是出錯,由於之前是在CentOS7上搭建的PHP環境,CentOS8上搭建PHP-7.運行環境,配置上略微有些區別。

下面是需要修改的配置:

#PHP配置文件
/etc/opt/remi/php74/php-fpm.d/www.conf
-------------------------------------------
;user = apache
;group = apache
;listen.acl_users = apache
-------------------------------------------
#將上面原有的用戶和羣組改爲nginx
-------------------------------------------
user = nginx
group = nginx
listen.acl_users = nginx
-------------------------------------------
#NGINX配置文件
/etc/nginx/nginx.conf
#添加下面配置
#※fastcgi_pass的設定要和[www.conf]的listen設定一致
-------------------------------------------
        location / {
            if (!-e $request_filename){
                rewrite ^/(.*)$ /index.php/$1 last;
            }
        }

        location ~ \.php {
            fastcgi_pass unix:/var/opt/remi/php74/run/php-fpm/www.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
            #定義變量 $path_info ,用於存放pathinfo信息
            set $path_info "";
            #定義變量 $real_script_name,用於存放真實地址
            set $real_script_name $fastcgi_script_name;
            #如果地址與引號內的正則表達式匹配
            if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
                #將文件地址賦值給變量 $real_script_name
                set $real_script_name $1;
                #將文件地址後的參數賦值給變量 $path_info
                set $path_info $2;
            }
            #配置fastcgi的一些參數
            fastcgi_param SCRIPT_NAME $real_script_name;
            fastcgi_param PATH_INFO $path_info;
        }
-------------------------------------------
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章