PHP学习-5 安装PHP

安装PHP

  • 1 PHP快速安装
  • 2 启动PHP
  • 3 其他

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学习-5 安装PHP_第1张图片
    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;
        }
-------------------------------------------

你可能感兴趣的:(PHP,Nginx,php,nginx)