# Centos8(Liunx) 中安装PHP7.4 的三种方法和删除它的三种方法
<https://www.lagou.com/lgeduarticle/97902.html>
### 编译安装
## Centos8下PHP源码编译和通过yum安装的区别和以后的选择
其实这两种方法各有千秋:
**yum安装:**
从yum安装来说吧,yum相当于是自动化帮你安装,你不用管软件的依赖关系,在yum安装过程是帮你把软件的全部依赖关系帮你傻瓜式的解决了。而且现在Centos7的服务启动已经换成systemctl命令来控制了。通过yum安装会帮你自动注册服务,你可以通过systemctl start xxx.service启动服务,方便快捷。但是缺点是yum安装你没办法干预,安装的目录也是分散的。你可能要执行whereis或者find命令去找yum安装的路径。有时候yum安装的软件版本比较低,你不得不去找其他的yum源,或者rpm包。
**源码安装:**
源码编译在安装过程中可能要解决很多的依赖问题,才能装好一个软件。装好的软件你还不能通过systemctl来启动服务,因为在/usr/lib/systemd/system/路径下并没有你的服务的配置文件,你要自己手写一个。但是好处在于你能选择软件的版本,自定义安装目录,安装的模块。更加灵活方便。
**LNMP一键安装:**
LNMP一键安装包是一个用Linux Shell编写的可以为CentOS/RHEL/Fedora/Aliyun/Amazon、Debian/Ubuntu/Raspbian/Deepin/Mint Linux VPS或独立主机安装LNMP(Nginx/MySQL/PHP)、LNMPA(Nginx/MySQL/PHP/Apache)、LAMP(Apache/MySQL/PHP)生产环境的Shell程序。无需一个一个的输入命令,无需值守,编译安装优化编译参数,提高性能,解决不必要的软件间依赖,特别针对配置自动优化。支持自定义Nginx、PHP编译参数及网站和数据库目录、支持生成LetseEcrypt证书、LNMP模式支持多PHP版本、支持单独安装Nginx/MySQL/MariaDB/Pureftpd服务器,同时提供一些实用的辅助工具如:虚拟主机管理、FTP用户管理、Nginx、MySQL/MariaDB、PHP的升级、常用缓存组件Redis/Xcache等的安装、重置MySQL root密码、502自动重启、日志切割、SSH防护DenyHosts/Fail2Ban、备份等许多实用脚本。
以上三种都是有各自的优点,建议是初学者一定要掌握源码编译的过程,手动解决安装过成中遇到的问题,熟悉如何编译一个软件,对于以后的发展是很有利的,而且有些软件没办法通过yum安装,这时候源码编译就显得很重要了。而像PHP这类软件来说,如果是编译安装的,如果缺少一个扩展,你就得做phpize, ./configure, make && make install等方式编译PHP扩展,这是很繁琐的。通过yum安装的话,当你要增加一个扩展,例如pdo,你就能够yum search php | grep pdo来寻找合适的pdo包,然后下载安装,系统会自动帮你添加到PHP扩展列表。省去我们很多工作。LNMP一键安装是为开发者快速搭建开发环境时使用,可以让开发者有更多时间在开发的业务逻辑上。
**1.使用yum命令([学习yum的基本知识](https://www.cnblogs.com/alliancehacker/p/12255450.html))**
**参考网站:**
```
<pre class="calibre10">```
# https<span class="token3">:</span><span class="token1">/</span><span class="token1">/</span>www<span class="token3">.</span>jb51<span class="token3">.</span>net<span class="token1">/</span>article<span class="token1">/</span><span class="token6">175918.</span>htm
# https<span class="token3">:</span><span class="token1">/</span><span class="token1">/</span>www<span class="token3">.</span>itgeeker<span class="token3">.</span>net<span class="token1">/</span>php7<span class="token1">-</span><span class="token6">3</span><span class="token1">-</span>yum<span class="token1">-</span>install<span class="token1">-</span>on<span class="token1">-</span>centos<span class="token1">-</span><span class="token6">7</span><span class="token1">/</span>
```
```
这个方法是比较简单的方法,可以很简单快速地安装php。([**rpm命令的基本用法和实例**](https://www.cnblogs.com/alliancehacker/p/12285348.html))
```
<pre class="calibre10">```
#添加几个源,不然会报错
#php高版本的yum源地址,有两部分,其中一部分是epel<span class="token1">-</span>release,另外一部分来自webtatic。如果跳过epel<span class="token1">-</span>release的话,安装webtatic的时候
rpm <span class="token1">-</span>Uvh https<span class="token3">:</span><span class="token1">/</span><span class="token1">/</span>dl<span class="token3">.</span>fedoraproject<span class="token3">.</span>org<span class="token1">/</span>pub<span class="token1">/</span>epel<span class="token1">/</span>epel<span class="token1">-</span>release<span class="token1">-</span>latest<span class="token1">-</span><span class="token6">8.</span>noarch<span class="token3">.</span>rpm
rpm <span class="token1">-</span>Uvh http<span class="token3">:</span><span class="token1">/</span><span class="token1">/</span>rpms<span class="token3">.</span>remirepo<span class="token3">.</span>net<span class="token1">/</span>enterprise<span class="token1">/</span>remi<span class="token1">-</span>release<span class="token1">-</span><span class="token6">8.</span>rpm
```
```

**添加相关的库后,启用 PHP 7.4 的 Remi 模块并进行安装。**
```
<pre class="calibre10">```
dnf <span class="token1">-</span>y install dnf<span class="token1">-</span>utils
```
```
```
<pre class="calibre10">```
#使用这个命令查看php7<span class="token3">.</span><span class="token6">4</span>
yum search php74<span class="token1">*</span>
```
```

**然后安装你想要的模块:**
```
<pre class="calibre10">```
php74:安装PHP <span class="token6">7.4</span>的包
php74<span class="token1">-</span>php:用于创建动态web的PHP脚本语言网站
php74<span class="token1">-</span>build:基本的构建配置
php74<span class="token1">-</span>php<span class="token1">-</span>gd:用于PHP应用程序使用gd的模块图形库
php74<span class="token1">-</span>xhprof:一个用于PHP <span class="token1">-</span> Web接口的层次分析器
php74<span class="token1">-</span>zephir:用于创建扩展的Zephir语言PHP:
php74<span class="token1">-</span>php<span class="token1">-</span>ast:抽象语法树
php74<span class="token1">-</span>php<span class="token1">-</span>cli:用于PHP的命令行接口
php74<span class="token1">-</span>php<span class="token1">-</span>dba:一个用于PHP的数据库抽象层模块应用程序
php74<span class="token1">-</span>php<span class="token1">-</span>dbg:交互式PHP调试器
php74<span class="token1">-</span>php<span class="token1">-</span>ffi:外部函数接口
php74<span class="token1">-</span>php<span class="token1">-</span>fpm:PHP FastCGI进程管理器
php74<span class="token1">-</span>php<span class="token1">-</span>gmp:一个用于使用GNU的PHP应用程序模块议员库
php74<span class="token1">-</span>php<span class="token1">-</span>lz4:x86_64<span class="token3">:</span> PHP的LZ4扩展
php74<span class="token1">-</span>php<span class="token1">-</span>pdo:一个用于PHP的数据库访问抽象模块应用程序
php74<span class="token1">-</span>php<span class="token1">-</span>xml:x86_64<span class="token3">:</span>用于使用XML的PHP应用程序的模块
php74<span class="token1">-</span>runtime:处理php74软件集合的包:
php74<span class="token1">-</span>php<span class="token1">-</span>imap:x86_64<span class="token3">:</span>用于使用IMAP的PHP应用程序的模块
php74<span class="token1">-</span>php<span class="token1">-</span>intl:x86_64<span class="token3">:</span> PHP国际化扩展应用程序
php74<span class="token1">-</span>php<span class="token1">-</span>json:x86_64<span class="token3">:</span> PHP的JavaScript对象符号扩展
php74<span class="token1">-</span>php<span class="token1">-</span>ldap:x86_64<span class="token3">:</span>用于使用LDAP的PHP应用程序的模块
php74<span class="token1">-</span>php<span class="token1">-</span>oci8:x86_64<span class="token3">:</span>用于使用OCI8的PHP应用程序的模块数据库
php74<span class="token1">-</span>php<span class="token1">-</span>odbc:x86_64<span class="token3">:</span>用于使用ODBC的PHP应用程序的模块数据库
php74<span class="token1">-</span>php<span class="token1">-</span>pear:noarch<span class="token3">:</span> PHP扩展和应用程序库框架
php74<span class="token1">-</span>php<span class="token1">-</span>pggi:GTK绑定
php74<span class="token1">-</span>php<span class="token1">-</span>snmp:一个用于PHP应用程序查询的模块SNMP<span class="token1">-</span>managed设备
php74<span class="token1">-</span>php<span class="token1">-</span>soap:用于使用SOAP的PHP应用程序的模块协议
php74<span class="token1">-</span>php<span class="token1">-</span>tidy:标准PHP模块提供了tidy库支持
php74<span class="token1">-</span>php<span class="token1">-</span>zstd:x86_64<span class="token3">:</span> Zstandard扩展名
php74<span class="token1">-</span>scldevel:x86_64<span class="token3">:</span>打包php74的开发文件
php74<span class="token1">-</span>unit<span class="token1">-</span>php:用于NGINX单元的PHP模块
php74<span class="token1">-</span>php<span class="token1">-</span>devel:构建PHP扩展所需的文件
php74<span class="token1">-</span>php<span class="token1">-</span>pgsql:一个用于PHP的PostgreSQL数据库模块
php74<span class="token1">-</span>php<span class="token1">-</span>pinba:x86_64<span class="token3">:</span> Pinba统计服务器的客户端扩展
php74<span class="token1">-</span>php<span class="token1">-</span>bcmath:用于PHP应用程序的模块bcmath库
php74<span class="token1">-</span>php<span class="token1">-</span>brotli:用于PHP的Brotli扩展
php74<span class="token1">-</span>php<span class="token1">-</span>common:PHP的公共文件
php74<span class="token1">-</span>php<span class="token1">-</span>pspell:x86_64<span class="token3">:</span>用于PHP应用程序的模块中接口
php74<span class="token1">-</span>php<span class="token1">-</span>recode:用于PHP应用程序的模块重新编码库
php74<span class="token1">-</span>php<span class="token1">-</span>snappy:PHP的Snappy扩展
php74<span class="token1">-</span>php<span class="token1">-</span>sodium:x86_64<span class="token3">:</span>钠密码库的包装
php74<span class="token1">-</span>php<span class="token1">-</span>sqlsrv:x86_64<span class="token3">:</span>用于SQL Server的PHP Microsoft驱动程序
php74<span class="token1">-</span>php<span class="token1">-</span>xmlrpc:的PHP应用程序模块xml <span class="token1">-</span> rpc协议
php74<span class="token1">-</span>php<span class="token1">-</span>enchant:增强PHP的拼写扩展应用程序
php74<span class="token1">-</span>php<span class="token1">-</span>libvirt:用于Libvirt的PHP语言绑定
php74<span class="token1">-</span>php<span class="token1">-</span>mysqlnd:x86_64<span class="token3">:</span>用于使用MySQL的PHP应用程序的模块数据库
php74<span class="token1">-</span>php<span class="token1">-</span>opcache:x86_64<span class="token3">:</span> Zend OPcache
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>ds:x86_64<span class="token3">:</span> PHP的数据结构
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>ev:提供libev库的接口
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>pq:PostgreSQL客户端库<span class="token3">(</span>libpq<span class="token3">)</span>绑定
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>uv:Libuv包装器
php74<span class="token1">-</span>php<span class="token1">-</span>process:用于PHP脚本的模块使用系统进程接口
php74<span class="token1">-</span>php<span class="token1">-</span>embedded:用于嵌入应用程序的PHP库
php74<span class="token1">-</span>php<span class="token1">-</span>mbstring:一个用于PHP应用程序的模块多字节字符串处理
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>dio:直接I<span class="token1">/</span>O函数
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>eio:提供libeio库的接口
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>env:加载环境变量
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>lua:嵌入式lua解释器
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>lzf:x86_64<span class="token3">:</span>处理LZF de<span class="token1">/</span>压缩的扩展
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>nsq:NSQ客户端的PHP扩展
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>psr:PSR接口
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>rar:用于读取RAR存档的PHP扩展
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>rrd:x86_64<span class="token3">:</span> rrdtool的PHP绑定
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>sdl:简单的PHP DirectMedia层
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>svn:x86_64<span class="token3">:</span> Subversion版本的PHP绑定控制系统
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>vld:x86_64<span class="token3">:</span>转储PHP的内部表示脚本
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>yac:无锁用户数据缓存
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>yaf:x86_64<span class="token3">:</span>又一个框架
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>yar:轻量级并发RPC框架
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>yaz:x86_64<span class="token3">:</span> Z39<span class="token3">.</span><span class="token6">50</span><span class="token1">/</span>SRU客户端
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>zip:一个ZIP文件的扩展名
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>zmq:ZeroMQ消息传递
php74<span class="token1">-</span>php<span class="token1">-</span>phalcon4:Phalcon框架
php74<span class="token1">-</span>php<span class="token1">-</span>componere:在运行时编写PHP类
php74<span class="token1">-</span>php<span class="token1">-</span>litespeed:LiteSpeed Web服务器PHP支持
php74<span class="token1">-</span>php<span class="token1">-</span>maxminddb:MaxMind DB Reader扩展
php74<span class="token1">-</span>php<span class="token1">-</span>pdo<span class="token1">-</span>dblib:x86_64<span class="token3">:</span> PDO驱动程序,用于Microsoft SQL Server和Sybase数据库
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>amqp:与任何AMQP兼容的服务器通信
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>apcu:APC用户缓存
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>apfd:总是填充表单数据
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>fann:用于FANN库的包装器
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>grpc:x86_64<span class="token3">:</span>通用RPC框架
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>http:扩展的HTTP支持
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>krb5:Kerberos验证扩展
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>pcov:x86_64<span class="token3">:</span>代码覆盖驱动程序
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>ssh2:x86_64<span class="token3">:</span> libssh2库的绑定
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>sync:已命名和未命名同步对象
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>uopz:x86_64<span class="token3">:</span> Zend的用户操作
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>uuid:通用唯一标识符扩展对于PHP
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>vips:x86_64<span class="token3">:</span>与libvip接口的PHP扩展
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>wddx:Web分布式数据交换
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>yaml:x86_64<span class="token3">:</span> yaml的PHP绑定
php74<span class="token1">-</span>php<span class="token1">-</span>phpiredis:x86_64<span class="token3">:</span> Redis的客户端扩展名
php74<span class="token1">-</span>php<span class="token1">-</span>smbclient:libsmbclient的PHP包装
php74<span class="token1">-</span>php<span class="token1">-</span>wkhtmltox:HTML转换器
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>cmark:CommonMark扩展名
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>dbase:dBase数据库文件访问函数
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>druid:一个PHP的德鲁伊驱动
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>event:提供libevent库的接口
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>geoip:将IP地址映射到的扩展名地理位置
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>gnupg:x86_64<span class="token3">:</span> gpgme库的包装
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>mysql:MySQL数据库访问函数
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>oauth:PHP OAuth消费者扩展
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>parle:x86_64<span class="token3">:</span>解析和词法分析
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>raphf:资源和持久句柄工厂
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>solr2:Apache Solr的API定向对象
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>stats:用于统计计算的例程
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>stomp:Stomp客户端扩展
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>taint:x86_64<span class="token3">:</span> XSS代码嗅探器
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>xattr:扩展属性
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>xdiff:文件差异<span class="token1">/</span>补丁
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>xxtea:XXTEA加密算法扩展PHP
php74<span class="token1">-</span>php<span class="token1">-</span>libvirt<span class="token1">-</span>doc:noarch<span class="token3">:</span> php<span class="token1">-</span>libvirt文件
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>base58:用base58编码和解码数据
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>bitset:位集库
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>crypto:OpenSSL密码库的包装器
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>gender:x86_64<span class="token3">:</span>性别扩展
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>hprose:用于PHP的h散文
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>hrtime:x86_64<span class="token3">:</span>高分辨率定时
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>mcrypt:x86_64<span class="token3">:</span> libmcrypt库的绑定
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>pdflib:生成PDF文件的包
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>propro:属性代理
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>radius:Radius客户端库
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>redis4:的扩展名 Redis键值存储
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>redis5:的扩展名 Redis键值存储
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>scrypt:Scrypt散列函数
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>sphinx:Sphinx SQL全文的PECL扩展搜索引擎
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>ssdeep:libfuzzy库的包装器
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>trader:为贸易商提供技术分析
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>xdebug:用于调试PHP脚本的PECL包
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>xhprof:x86_64<span class="token3">:</span> XHProf的PHP扩展,层次结构分析器
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>yaconf:x86_64<span class="token3">:</span>另一个配置容器
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>apcu<span class="token1">-</span>bc:APCu向后兼容模块
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>decimal:任意精度浮点小数
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>gearman:PHP包装器到libgearman
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>gmagick:的包装器GraphicsMagick库
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>imagick:x86_64<span class="token3">:</span>用于创建和修改映像的扩展使用ImageMagick
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>inotify:x86_64<span class="token3">:</span> Inotify
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>leveldb:LevelDB PHP绑定
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>memprof:x86_64<span class="token3">:</span>内存使用分析器
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>mongodb:x86_64<span class="token3">:</span>用于PHP的MongoDB驱动程序
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>msgpack:用于与MessagePack通信的API序列化
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>rdkafka:基于librdkafka的Kafka客户端
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>rpminfo:x86_64<span class="token3">:</span> RPM信息
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>runkit7:为了这些你…不应该…无论如何我一直在做……但是肯定做的<span class="token1">!</span>
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>seaslog:一个有效、快速、稳定的日志 PHP扩展
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>selinux:用于PHP脚本的SELinux绑定语言
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>swoole4:PHP的异步并发分布式网络框架
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>timecop:x86_64<span class="token3">:</span>时间旅行和冻结扩展
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>varnish:Varnish缓存绑定
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>xmldiff:x86_64<span class="token3">:</span> XML差异和合并
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>igbinary:x86_64<span class="token3">:</span>替代标准PHP序列化器
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>memcache:x86_64<span class="token3">:</span>使用Memcached的扩展缓存守护进程
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>mogilefs:要与之通信的PHP客户端库 MogileFS存储
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>mustache:Mustache模板语言
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>protobuf:序列化结构化的机制数据
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>rdkafka4:基于librdkafka的Kafka客户端
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>scoutapm:本地扩展组件 ScoutAPM的PHP代理
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>translit:将非拉丁字符音译设置为拉丁文
php74<span class="token1">-</span>php<span class="token1">-</span>snuffleupagus:x86_64<span class="token3">:</span> PHP的安全模块
php74<span class="token1">-</span>php<span class="token1">-</span>zephir<span class="token1">-</span>parser:x86_64<span class="token3">:</span> Zephir解析器扩展
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>cassandra:用于Apache的DataStax PHP驱动程序卡桑德拉
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>json<span class="token1">-</span>post:JSON POST处理程序
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>mailparse:用于解析和的PHP PECL包处理电子邮件消息
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>memcached:x86_64<span class="token3">:</span>使用Memcached的扩展缓存守护进程
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>mosquitto:libmosquito <span class="token1">-</span> to的扩展
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>seasclick:一个Yandex ClickHouse客户端驱动 PHP扩展
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>xlswriter:一个高效、快速的xlsx文件出口扩展
php74<span class="token1">-</span>php<span class="token1">-</span>horde<span class="token1">-</span>horde<span class="token1">-</span>lz4:Horde LZ4压缩扩展
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>apcu<span class="token1">-</span>devel:APCu开发人员文件<span class="token3">(</span>头文件<span class="token3">)</span>
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>couchbase2:Couchbase服务器PHP扩展
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>geospatial:PHP扩展来处理公共地理空间功能
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>handlebars:Handlebars模板语言
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>http<span class="token1">-</span>devel:x86_64<span class="token3">:</span>扩展HTTP支持开发人员文件<span class="token3">(</span>头<span class="token3">)</span>
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>krb5<span class="token1">-</span>devel:Kerberos扩展开发人员文件<span class="token3">(</span>头<span class="token3">)</span>
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>luasandbox:带有限制和安全的Lua解释器环境
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>opencensus:一个stats集合和分布式跟踪框架
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>skywalking:x86_64<span class="token3">:</span> Apache的PHP工具代理人行天桥
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>ahocorasick:有效的Aho<span class="token1">-</span>Corasick字符串模式匹配算法
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>ip2location:获取an的地理位置信息IP地址
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>http<span class="token1">-</span>message:x86_64<span class="token3">:</span> PSR<span class="token1">-</span><span class="token6">7</span> HTTP消息实现
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>datadog<span class="token1">-</span>trace:APM和分布式跟踪PHP
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>hdr<span class="token1">-</span>histogram:x86_64<span class="token3">:</span> C语言的PHP扩展包装hdrhistogram API
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>imagick<span class="token1">-</span>devel:imagick扩展开发人员文件<span class="token3">(</span>头<span class="token3">)</span>
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>msgpack<span class="token1">-</span>devel:MessagePack开发人员文件<span class="token3">(</span>头<span class="token3">)</span>
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>mysql<span class="token1">-</span>xdevapi:MySQL数据库访问函数
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>mysqlnd<span class="token1">-</span>azure:x86_64<span class="token3">:</span> mysqlnd的重定向插件
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>igbinary<span class="token1">-</span>devel:Igbinary开发人员文件<span class="token3">(</span>头<span class="token3">)</span>
php74<span class="token1">-</span>php<span class="token1">-</span>pecl<span class="token1">-</span>uploadprogress:x86_64<span class="token3">:</span>跟踪进度的扩展文件上传
```
```
```
<pre class="calibre10">```
# 运行一下
yum install php74<span class="token1">-</span>php
```
```

\*\* 使用如下命令安装额外的包\*\*
```
<pre class="calibre10">```
yum search php74<span class="token1">*</span>
yum install php74<span class="token1">-</span>xxx
```
```
**运行并查看版本, 重启命令, 添加自动启动,链接php文件**
```
<pre class="calibre10">```
#运行并查看版本
php74 <span class="token1">-</span>v
#重启命令php<span class="token1">-</span>fpm
systemctl restart php74<span class="token1">-</span>php<span class="token1">-</span>fpm
#添加自动启动
systemctl enable php74<span class="token1">-</span>php<span class="token1">-</span>fpm
#查看php7<span class="token3">.</span><span class="token6">4</span>的安装路径
whereis php
#链接php文件
ln <span class="token1">-</span>s <span class="token1">/</span>opt<span class="token1">/</span>remi<span class="token1">/</span>php74<span class="token1">/</span>root<span class="token1">/</span>usr<span class="token1">/</span>bin<span class="token1">/</span>php <span class="token1">/</span>usr<span class="token1">/</span>bin<span class="token1">/</span>php
```
```



**一些配置文件的路径**
```
<pre class="calibre10">```
# The current PHP memory limit is below the recommended value of <span class="token6">512</span>MB<span class="token3">.</span>
vi <span class="token1">/</span>etc<span class="token1">/</span>opt<span class="token1">/</span>remi<span class="token1">/</span>php74<span class="token1">/</span>php<span class="token3">.</span>ini
memory_limit <span class="token1">=</span> <span class="token6">512</span>M
#如果你运行的是nginx而不是apache,修改
vi <span class="token1">/</span>etc<span class="token1">/</span>opt<span class="token1">/</span>remi<span class="token1">/</span>php74<span class="token1">/</span>php<span class="token1">-</span>fpm<span class="token3">.</span>d<span class="token1">/</span>www<span class="token3">.</span>conf
user <span class="token1">=</span> apache
group <span class="token1">=</span> apache
# Replace the values with
user <span class="token1">=</span> nginx
group <span class="token1">=</span> nginx
```
```
**卸载所有php7.4**
```
<pre class="calibre10">```
yum remove php74<span class="token1">-</span>php<span class="token1">*</span>
```
```

## 2.编译安装PHP以及需要的基本扩展库(php7.4)
**参考网站:**
<https://www.php.net/manual/zh/install.php>
<https://www.cnblogs.com/werben/p/11833903.html>
<https://www.cnblogs.com/ckh2014/p/10909672.html>
<https://www.24kplus.com/linux/1614.html>
### 下载php源码
用php的官网,有很多源的,想要什么版本可以自己选一下
<https://www.php.net/distributions/php-7.4.2.tar.bz2>
```
<pre class="calibre10">```
#回到用户目录
cd <span class="token1">~</span>
#下载php7<span class="token3">.</span><span class="token6">4</span>源码
wget https<span class="token3">:</span><span class="token1">/</span><span class="token1">/</span>www<span class="token3">.</span>php<span class="token3">.</span>net<span class="token1">/</span>distributions<span class="token1">/</span>php<span class="token1">-</span><span class="token6">7.4</span><span class="token6">.2</span><span class="token3">.</span>tar<span class="token3">.</span>bz2
```
```

下载完成

[\*\* 解压文的基本命令和实例\*\*](https://www.cnblogs.com/alliancehacker/p/12284186.html)
```
<pre class="calibre10">```
# 把它移动到usr<span class="token1">/</span>local文件下操作,我个人习惯
mv php<span class="token1">-</span><span class="token6">7.4</span><span class="token6">.2</span><span class="token3">.</span>tar<span class="token3">.</span>bz2 <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>php<span class="token1">-</span><span class="token6">7.4</span><span class="token6">.2</span><span class="token3">.</span>tar<span class="token3">.</span>bz2
# 切换文件目录
cd <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>
# 解压文件
tar <span class="token1">--</span>bzip <span class="token1">-</span>xvf <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>php<span class="token1">-</span><span class="token6">7.4</span><span class="token6">.2</span><span class="token3">.</span>tar<span class="token3">.</span>bz2
# 切换文件目录
cd php<span class="token1">-</span><span class="token6">7.4</span><span class="token6">.2</span>
```
```


### 安装编译工具和库
安装php的依赖库和安装编译的工具,无论有没有装都可以执行一下
```
<pre class="calibre10">```
yum <span class="token1">-</span>y install gcc gcc<span class="token1">-</span>c<span class="token1">++</span>
yum <span class="token1">-</span>y install libxml2<span class="token1">-</span>devel openssl<span class="token1">-</span>devel curl<span class="token1">-</span>devel libjpeg<span class="token1">-</span>devel libpng<span class="token1">-</span>devel libicu<span class="token1">-</span>devel freetype<span class="token1">-</span>devel openldap<span class="token1">-</span>de
```
```

\*\* 创建用户组和用户\*\*
```
<pre class="calibre10">```
groupadd www
useradd <span class="token1">-</span>g www www
```
```
## **php ./configure的一些参数及意义**
```
<pre class="calibre10">```
PHP编译参数的含义
<span class="token3">.</span><span class="token1">/</span>configure
–prefix<span class="token1">=</span><span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>php php安装目录
–with<span class="token1">-</span>apxs2<span class="token1">=</span><span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>apache<span class="token1">/</span>bin<span class="token1">/</span>apxs
–with<span class="token1">-</span>config<span class="token1">-</span>file<span class="token1">-</span>path<span class="token1">=</span><span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>php<span class="token1">/</span>etc 指定php<span class="token3">.</span>ini位置
–with<span class="token1">-</span>MySQL<span class="token1">=</span><span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>mysql mysql安装目录,对mysql的支持
–with<span class="token1">-</span>mysqli<span class="token1">=</span><span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>mysql<span class="token1">/</span>bin<span class="token1">/</span>mysql_config mysqli文件目录<span class="token3">,</span>优化支持
–enable<span class="token1">-</span>safe<span class="token1">-</span>mode 打开安全模式
–enable<span class="token1">-</span>ftp 打开ftp的支持
–enable<span class="token1">-</span>zip 打开对zip的支持
–with<span class="token1">-</span>bz2 打开对bz2文件的支持
–with<span class="token1">-</span>jpeg<span class="token1">-</span>dir 打开对jpeg图片的支持
–with<span class="token1">-</span>png<span class="token1">-</span>dir 打开对png图片的支持
–with<span class="token1">-</span>freetype<span class="token1">-</span>dir 打开对freetype字体库的支持
–without<span class="token1">-</span>iconv 关闭iconv函数,种字符集间的转换
–with<span class="token1">-</span>libxml<span class="token1">-</span>dir 打开libxml2库的支持
–with<span class="token1">-</span>xmlrpc 打开xml<span class="token1">-</span>rpc的C语言
–with<span class="token1">-</span>zlib<span class="token1">-</span>dir 打开zlib库的支持
–with<span class="token1">-</span>gd 打开gd库的支持
–enable<span class="token1">-</span>gd<span class="token1">-</span>native<span class="token1">-</span>ttf 支持TrueType字符串函数库
–with<span class="token1">-</span>curl 打开curl浏览工具的支持
–with<span class="token1">-</span>curlwrappers 运用curl工具打开url流
–with<span class="token1">-</span>ttf 打开freetype1<span class="token3">.</span><span class="token1">*</span>的支持,可以不加了
–with<span class="token1">-</span>xsl 打开XSLT文件支持,扩展了libxml2库 ,需要libxslt软件
–with<span class="token1">-</span>gettext 打开gnu的gettext 支持,编码库用到
–with<span class="token1">-</span>pear 打开pear命令的支持,php扩展用的
–enable<span class="token1">-</span>calendar 打开日历扩展功能
–enable<span class="token1">-</span>mbstring 多字节,字符串的支持
–enable<span class="token1">-</span>bcmath 打开图片大小调整<span class="token3">,</span>用到zabbix监控的时候用到了这个模块
–enable<span class="token1">-</span>sockets 打开sockets 支持
–enable<span class="token1">-</span>exif 图片的元数据支持
–enable<span class="token1">-</span>magic<span class="token1">-</span>quotes 魔术引用的支持
–disable<span class="token1">-</span>rpath 关闭额外的运行库文件
–disable<span class="token1">-</span>debug 关闭调试模式
–with<span class="token1">-</span>mime<span class="token1">-</span>magic<span class="token1">=</span><span class="token1">/</span>usr<span class="token1">/</span>share<span class="token1">/</span>file<span class="token1">/</span>magic<span class="token3">.</span>mime 魔术头文件位置
cgi方式安装才用的参数
–enable<span class="token1">-</span>fpm 打上php<span class="token1">-</span>fpm补丁后才有这个参数,cgi方式安装的启动程序
–enable<span class="token1">-</span>fastcgi 支持fastcgi方式启动php
–enable<span class="token1">-</span>force<span class="token1">-</span>cgi<span class="token1">-</span>redirect 同上<span class="token3">,</span>帮助里没有解释
–with<span class="token1">-</span>ncurses 支持ncurses屏幕绘制以及基于文本终端的图形互动功能的动态库
–enable<span class="token1">-</span>pcntl freeTDS需要用到的,可能是链接mssql才用到
mhash和mcrypt算法的扩展
–with<span class="token1">-</span>mcrypt 算法
–with<span class="token1">-</span>mhash 算法
–with<span class="token1">-</span>gmp
–enable<span class="token1">-</span>inline<span class="token1">-</span>optimization
–with<span class="token1">-</span>openssl openssl的支持,加密传输时用到的
–enable<span class="token1">-</span>dbase
–with<span class="token1">-</span>pcre<span class="token1">-</span>dir<span class="token1">=</span><span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>bin<span class="token1">/</span>pcre<span class="token1">-</span>config perl的正则库案安装位置
–disable<span class="token1">-</span>dmalloc
–with<span class="token1">-</span>gdbm dba的gdbm支持
–enable<span class="token1">-</span>sigchild
–enable<span class="token1">-</span>sysvsem
–enable<span class="token1">-</span>sysvshm
–enable<span class="token1">-</span>zend<span class="token1">-</span>multibyte 支持zend的多字节
–enable<span class="token1">-</span>mbregex
–enable<span class="token1">-</span>wddx
–enable<span class="token1">-</span>shmop
–enable<span class="token1">-</span>soap
PHP配置选项完整列表
数据库选项
<span class="token1">--</span>with<span class="token1">-</span>dbplus 包括 dbplus 的支持。
<span class="token1">--</span>with<span class="token1">-</span>adabas<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包括 Adabas D 的支持。DIR 是 Adabas 的基本安装目录,默认为 <span class="token1">/</span>usr<span class="token1">/</span>local。
<span class="token1">--</span>with<span class="token1">-</span>sapdb<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包括 SAP DB 的支持。DIR 是 SAP DB 的基本安装目录,默认为 <span class="token1">/</span>usr<span class="token1">/</span>local。
<span class="token1">--</span>with<span class="token1">-</span>solid<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包括 Solid 的支持。DIR 是 Solid 的基本安装目录,默认为 <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>solid。
<span class="token1">--</span>with<span class="token1">-</span>ibm<span class="token1">-</span>db2<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包括 IBM DB2 的支持。DIR 是 DB2 的基本安装目录,默认为 <span class="token1">/</span>home<span class="token1">/</span>db2inst1<span class="token1">/</span>sqllib。
<span class="token1">--</span>with<span class="token1">-</span>empress<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包括 Empress 的支持。DIR 是 Empress 的基本安装目录,默认为 $EMPRESSPATH。自 PHP4起,本选项仅支持 Empress <span class="token6">8.60</span> 及以上版本。
<span class="token1">--</span>with<span class="token1">-</span>empress<span class="token1">-</span>bcs<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包括 Empress Local Access 的支持。DIR 是 Empress 的基本安装目录,默认为$EMPRESSPATH。自 PHP4 起,本选项仅支持 Empress <span class="token6">8.60</span> 及以上版本。
<span class="token1">--</span>with<span class="token1">-</span>birdstep<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包括 Birdstep 的支持。DIR 是 Birdstep 的基本安装目录,默认为<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>birdstep。
<span class="token1">--</span>with<span class="token1">-</span>custom<span class="token1">-</span>odbc<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包括用户自定义 ODBC 的支持。DIR 是 ODBC 的基本安装目录,默认为 <span class="token1">/</span>usr<span class="token1">/</span>local。要确认定义了CUSTOM_ODBC_LIBS 并且在 include 目录中有某个 odbc<span class="token3">.</span>h。例如,对于 QNX 下的 Sybase SQLAnywhere <span class="token6">5.5</span><span class="token6">.00</span>,在运行 configure 脚本之前应该先定义以下环境变量: CPPFLAGS<span class="token1">=</span><span class="token2">"-DODBC_QNX-DSQLANY_BUG"</span> LDFLAGS<span class="token1">=</span><span class="token1">-</span>lunix CUSTOM_ODBC_LIBS<span class="token1">=</span><span class="token2">"-ldblib-lodbc"</span><span class="token3">.</span>
<span class="token1">--</span>with<span class="token1">-</span>iodbc<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包括 iODBC 的支持。DIR 是 iODBC 的基本安装目录,默认为 <span class="token1">/</span>usr<span class="token1">/</span>local。
<span class="token1">--</span>with<span class="token1">-</span>esoob<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包括 Easysoft OOB 的支持。DIR 是 OOB 的基本安装目录,默认为<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>easysoft<span class="token1">/</span>oob<span class="token1">/</span>client。
<span class="token1">--</span>with<span class="token1">-</span>unixODBC<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包括 unixODBC 的支持。DIR 是 unixODBC 的基本安装目录,默认为 <span class="token1">/</span>usr<span class="token1">/</span>local。
<span class="token1">--</span>with<span class="token1">-</span>openlink<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包括 OpenLink ODBC 的支持。DIR 是 OpenLink 的基本安装目录,默认为 <span class="token1">/</span>usr<span class="token1">/</span>local。这和 iODBC一样。
<span class="token1">--</span>with<span class="token1">-</span>dbmaker<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包括 DBMaker 的支持。DIR 是 DBMaker 的基本安装目录,默认为最新版 DBMaker 安装的目录(例如<span class="token1">/</span>home<span class="token1">/</span>dbmaker<span class="token1">/</span><span class="token6">3.6</span>)。
<span class="token1">--</span>disable<span class="token1">-</span>unified<span class="token1">-</span>odbc 取消对 unified ODBC 的支持。仅适用于激活了 iODBC,Adabas,Solid,Velocis 或用户自定义 ODBC界面。仅能用于 PHP <span class="token6">3</span>!
图像选项
<span class="token1">--</span>without<span class="token1">-</span>gd 禁用 GD 支持。仅用于 PHP <span class="token6">3</span>!
<span class="token1">--</span>with<span class="token1">-</span>imagick Imagick 扩展被移到 PEAR 中的 PECL 中去了,可以在这里找到。PHP <span class="token6">4</span> 中的安装指示可以在 PEAR站点中找到。只用 <span class="token1">--</span>with<span class="token1">-</span>imagick 仅在 PHP <span class="token6">3</span> 中支持,除非依照 PEAR 站点的指示去做。
<span class="token1">--</span>with<span class="token1">-</span>ming<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包括 ming 支持。
杂类选项
<span class="token1">--</span>enable<span class="token1">-</span>force<span class="token1">-</span>cgi<span class="token1">-</span>redirect 激活服务器内部重定向的安全检查。如果是在 Apache 中以 CGI 方式使用 PHP 则应该使用此选项。
<span class="token1">--</span>enable<span class="token1">-</span>discard<span class="token1">-</span>path 使用此选项可以使 PHP 的 CGI 可执行程序安全地放置在 web 目录树以外的地方,并且别人也不能绕过 <span class="token3">.</span>htaccess的安全设置。
<span class="token1">--</span>with<span class="token1">-</span>fastcgi 将 PHP 编译成 FastCGI 应用程序。
<span class="token1">--</span>enable<span class="token1">-</span>debug 编译时加入调试符号。
<span class="token1">--</span>with<span class="token1">-</span>layout<span class="token1">=</span>TYPE 设置安装后的文件布局。TYPE 可以是 PHP(默认值)或者 GNU。
<span class="token1">--</span>with<span class="token1">-</span>pear<span class="token1">=</span>DIR 将 PEAR 安装在 DIR 目录中(默认为 PREFIX<span class="token1">/</span>lib<span class="token1">/</span>php)。
<span class="token1">--</span>without<span class="token1">-</span>pear 不安装 PEAR。
<span class="token1">--</span>enable<span class="token1">-</span>sigchild 激活 PHP 自己的 SIGCHILD 句柄。
<span class="token1">--</span>disable<span class="token1">-</span>rpath 禁止传递附加的运行时库搜索路径。
<span class="token1">--</span>enable<span class="token1">-</span>libgcc 激活显式 libgcc 连接。
<span class="token1">--</span>enable<span class="token1">-</span>php<span class="token1">-</span>streams 包含试验的 PHP 流。除非是测试源代码,否则不要使用!
<span class="token1">--</span>with<span class="token1">-</span>zlib<span class="token1">-</span>dir<span class="token1">=</span><span class="token1"><</span>DIR<span class="token1">></span> 定义zlib 的安装路径。
<span class="token1">--</span>with<span class="token1">-</span>aspell<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包含 ASPELL 支持。
<span class="token1">--</span>with<span class="token1">-</span>ccvs<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包含 CCVS 支持。
<span class="token1">--</span>with<span class="token1">-</span>cybercash<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包含 CyberCash 支持。DIR 是 CyberCash MCK 的安装目录。
<span class="token1">--</span>with<span class="token1">-</span>icap<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包含 ICAP 支持。
<span class="token1">--</span>with<span class="token1">-</span>ircg<span class="token1">-</span>config ircg<span class="token1">-</span>config 脚本的路径。
<span class="token1">--</span>with<span class="token1">-</span>ircg 包含 ircg 支持。
<span class="token1">--</span>enable<span class="token1">-</span>mailparse 包含 mailparse 支持。
<span class="token1">--</span>with<span class="token1">-</span>muscat<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包含 muscat 支持。
<span class="token1">--</span>with<span class="token1">-</span>satellite<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 激活通过 Satellite(试验性质)的 CORBA 支持。DIR 是 ORBit 的主目录。
<span class="token1">--</span>enable<span class="token1">-</span>trans<span class="token1">-</span>sid 激活透明的 session id 传播。
<span class="token1">--</span>with<span class="token1">-</span>regex<span class="token3">[</span><span class="token1">=</span>TYPE<span class="token3">]</span> 使用系统 regex 库(不赞成)。
<span class="token1">--</span>with<span class="token1">-</span>vpopmail<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包含 vpopmail 支持。
<span class="token1">--</span>with<span class="token1">-</span>tsrm<span class="token1">-</span>pthreads 使用 POSIX 线程(默认值)。
<span class="token1">--</span>enable<span class="token1">-</span>shared<span class="token3">[</span><span class="token1">=</span>PKGS<span class="token3">]</span> 编译共享库 <span class="token3">[</span>default<span class="token1">=</span>yes<span class="token3">]</span>。
<span class="token1">--</span>enable<span class="token1">-</span>static<span class="token3">[</span><span class="token1">=</span>PKGS<span class="token3">]</span> 编译静态库 <span class="token3">[</span>default<span class="token1">=</span>yes<span class="token3">]</span>。
<span class="token1">--</span>enable<span class="token1">-</span>fast<span class="token1">-</span>install<span class="token3">[</span><span class="token1">=</span>PKGS<span class="token3">]</span> 为快速安装而优化 <span class="token3">[</span>default<span class="token1">=</span>yes<span class="token3">]</span>。
<span class="token1">--</span>with<span class="token1">-</span>gnu<span class="token1">-</span>ld 假定 C 编译器使用 GNU ld <span class="token3">[</span>default<span class="token1">=</span>no<span class="token3">]</span>。
<span class="token1">--</span>disable<span class="token1">-</span>libtool<span class="token1">-</span>lock 避免锁死(可能会破坏并行编译)。
<span class="token1">--</span>with<span class="token1">-</span>pic 尝试只使用 PIC<span class="token1">/</span>non<span class="token1">-</span>PIC 对象 <span class="token3">[</span>default<span class="token1">=</span>use both<span class="token3">]</span>。
<span class="token1">--</span>enable<span class="token1">-</span>memory<span class="token1">-</span>limit 编译时加入内存限制支持。
<span class="token1">--</span>disable<span class="token1">-</span>url<span class="token1">-</span>fopen<span class="token1">-</span>wrapper 禁止通过 URL 的 fopen wrapper,不能通过 HTTP 或 FTP 访问文件。
<span class="token1">--</span>enable<span class="token1">-</span>versioning 仅输出所需要的符号。更多信息见 INSTALL 文件。
<span class="token1">--</span>with<span class="token1">-</span>imsp<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包含 IMSp 支持(DIR 是 IMSP 的 include 目录和 libimsp<span class="token3">.</span>a 目录)。仅用于 PHP <span class="token6">3</span>!
<span class="token1">--</span>with<span class="token1">-</span>mck<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包含 Cybercash MCK 支持。DIR 是 cybercash mck 编译目录,默认为<span class="token1">/</span>usr<span class="token1">/</span>src<span class="token1">/</span>mck<span class="token1">-</span><span class="token6">3.2</span><span class="token6">.0</span><span class="token6">.3</span><span class="token1">-</span>Linux。帮助见 extra<span class="token1">/</span>cyberlib。仅用于 PHP <span class="token6">3</span>!
<span class="token1">--</span>with<span class="token1">-</span>mod<span class="token1">-</span>dav<span class="token1">=</span>DIR 包含通过 Apache 的 mod_dav 的 DAV 支持。DIR 是 mod_dav 的安装目录(仅用于 Apache模块版本!)仅用于 PHP <span class="token6">3</span>!
<span class="token1">--</span>enable<span class="token1">-</span>debugger 编译入远程调试函数。仅用于 PHP <span class="token6">3</span>!
<span class="token1">--</span>enable<span class="token1">-</span>versioning 利用 Solaris <span class="token6">2.</span>x 和 Linux 提供的版本控制与作用范围的优势。仅用于 PHP <span class="token6">3</span>!
PHP 选项
<span class="token1">--</span>enable<span class="token1">-</span>maintainer<span class="token1">-</span>mode 激活将编译规则和未使用的(以及一些混淆的)依赖文件放入临时安装中。
<span class="token1">--</span>with<span class="token1">-</span>config<span class="token1">-</span>file<span class="token1">-</span>path<span class="token1">=</span>PATH 设定php<span class="token3">.</span>ini 所在的路径,默认为PREFIX<span class="token1">/</span>lib。
<span class="token1">--</span>enable<span class="token1">-</span>safe<span class="token1">-</span>mode 默认激活安全模式。
<span class="token1">--</span>with<span class="token1">-</span>exec<span class="token1">-</span>dir<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 安全模式下只允许此目录下执行程序。默认为<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>php<span class="token1">/</span>bin。
<span class="token1">--</span>enable<span class="token1">-</span>magic<span class="token1">-</span>quotes 默认激活 magic quotes。
<span class="token1">--</span>disable<span class="token1">-</span>short<span class="token1">-</span>tags 默认禁止简写的 PHP 开始标记 <span class="token1"><</span><span class="token1">?</span>。
服务器选项
<span class="token1">--</span>with<span class="token1">-</span>aolserver<span class="token1">=</span>DIR 指定已安装的 AOLserver 的路径。
<span class="token1">--</span>with<span class="token1">-</span>apxs<span class="token3">[</span><span class="token1">=</span>FILE<span class="token3">]</span> 编译共享 Apache 模块。FILE 是可选的 Apache 的 apxs 工具的路径,默认为 apxs。确保指定的 apxs版本是安装后的文件而不是 Apache 源程序中包中的。
<span class="token1">--</span>with<span class="token1">-</span>apache<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 编译Apache 模块。DIR是 Apache 源程序的最高一级目录。默认为<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>apache。
<span class="token1">--</span>with<span class="token1">-</span>mod_charset 激活 mod_charset 中的传递表(Apache 中)。
<span class="token1">--</span>with<span class="token1">-</span>apxs2<span class="token3">[</span><span class="token1">=</span>FILE<span class="token3">]</span> 编译共享的Apache <span class="token6">2.0</span> 模块。FILE是可选的 Apache 的apxs 工具的路径,默认为apxs。
<span class="token1">--</span>with<span class="token1">-</span>fhttpd<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 编译 fhttpd 模块。DIR 是 fhttpd 的源代码路径,默认为 <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>src<span class="token1">/</span>fhttpd。
<span class="token1">--</span>with<span class="token1">-</span>isapi<span class="token1">=</span>DIR 将 PHP 编译为 ISAPI 模块用于 Zeus。
<span class="token1">--</span>with<span class="token1">-</span>nsapi<span class="token1">=</span>DIR 指定已安装的 Netscape 服务器路径。
<span class="token1">--</span>with<span class="token1">-</span>phttpd<span class="token1">=</span>DIR
<span class="token1">--</span>with<span class="token1">-</span>pi3web<span class="token1">=</span>DIR 将 PHP 编译为用于 Pi3Web 的模块。
<span class="token1">--</span>with<span class="token1">-</span>roxen<span class="token1">=</span>DIR 将 PHP 编译为一个 Pike 模块。DIR 是 Roxen 的根目录,通常为<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>roxen<span class="token1">/</span>server。
<span class="token1">--</span>enable<span class="token1">-</span>roxen<span class="token1">-</span>zts 编译 Roxen 模块,使用 Zend Thread Safety。
<span class="token1">--</span>with<span class="token1">-</span>servlet<span class="token3">[</span><span class="token1">=</span>DIR<span class="token3">]</span> 包含 servlet 支持。DIR 是 JSDK 的基本安装目录。本 SAPI 需要 Java 扩展必须被编译为共享的dl。
<span class="token1">--</span>with<span class="token1">-</span>thttpd<span class="token1">=</span>SRCDIR 将 PHP 编译为 thttpd 模块。
<span class="token1">--</span>with<span class="token1">-</span>tux<span class="token1">=</span>MODULEDIR 将 PHP 编译为 TUX 模块(仅用于 Linux)。
```
```
\*\* 配置fpm的用户组和用户,以及安装其他扩展\*\*
```
<pre class="calibre10">```
<span class="token3">.</span><span class="token1">/</span>configure <span class="token1">--</span>prefix<span class="token1">=</span><span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>php
<span class="token1">--</span>enable<span class="token1">-</span>fpm
<span class="token1">--</span>with<span class="token1">-</span>fpm<span class="token1">-</span>user<span class="token1">=</span>www
<span class="token1">--</span>with<span class="token1">-</span>fpm<span class="token1">-</span>group<span class="token1">=</span>www
<span class="token1">--</span>enable<span class="token1">-</span>mysqlnd
<span class="token1">--</span>with<span class="token1">-</span>mysqli<span class="token1">=</span>mysqlnd
<span class="token1">--</span>with<span class="token1">-</span>pdo<span class="token1">-</span>mysql<span class="token1">=</span>mysqlnd
<span class="token1">--</span>enable<span class="token1">-</span>mysqlnd<span class="token1">-</span>compression<span class="token1">-</span>support
<span class="token1">--</span>with<span class="token1">-</span>iconv<span class="token1">-</span>dir
<span class="token1">--</span>with<span class="token1">-</span>freetype<span class="token1">-</span>dir
<span class="token1">--</span>with<span class="token1">-</span>jpeg<span class="token1">-</span>dir
<span class="token1">--</span>with<span class="token1">-</span>png<span class="token1">-</span>dir
<span class="token1">--</span>with<span class="token1">-</span>zlib
<span class="token1">--</span>with<span class="token1">-</span>libxml<span class="token1">-</span>dir
<span class="token1">--</span>enable<span class="token1">-</span>xml
<span class="token1">--</span>disable<span class="token1">-</span>rpath
<span class="token1">--</span>enable<span class="token1">-</span>bcmath
<span class="token1">--</span>enable<span class="token1">-</span>shmop
<span class="token1">--</span>enable<span class="token1">-</span>sysvsem
<span class="token1">--</span>enable<span class="token1">-</span>inline<span class="token1">-</span>optimization
<span class="token1">--</span>with<span class="token1">-</span>curl
<span class="token1">--</span>enable<span class="token1">-</span>mbregex
<span class="token1">--</span>enable<span class="token1">-</span>mbstring
<span class="token1">--</span>enable<span class="token1">-</span>intl
<span class="token1">--</span>with<span class="token1">-</span>mcrypt
<span class="token1">--</span>with<span class="token1">-</span>libmbfl
<span class="token1">--</span>enable<span class="token1">-</span>ftp
<span class="token1">--</span>with<span class="token1">-</span>gd
<span class="token1">--</span>enable<span class="token1">-</span>gd<span class="token1">-</span>jis<span class="token1">-</span>conv
<span class="token1">--</span>enable<span class="token1">-</span>gd<span class="token1">-</span>native<span class="token1">-</span>ttf
<span class="token1">--</span>with<span class="token1">-</span>openssl
<span class="token1">--</span>with<span class="token1">-</span>mhash
<span class="token1">--</span>enable<span class="token1">-</span>pcntl
<span class="token1">--</span>enable<span class="token1">-</span>sockets
<span class="token1">--</span>with<span class="token1">-</span>xmlrpc
<span class="token1">--</span>enable<span class="token1">-</span>zip
<span class="token1">--</span>enable<span class="token1">-</span>soap
<span class="token1">--</span>with<span class="token1">-</span>gettext
<span class="token1">--</span>disable<span class="token1">-</span>fileinfo
<span class="token1">--</span>enable<span class="token1">-</span>opcache
<span class="token1">--</span>with<span class="token1">-</span>pear
<span class="token1">--</span>enable<span class="token1">-</span>maintainer<span class="token1">-</span>zts
<span class="token1">--</span>with<span class="token1">-</span>ldap<span class="token1">=</span>shared
<span class="token1">--</span>without<span class="token1">-</span>gdbm
```
```
开始检查依赖,做编译安前的准备

**一般都会有错误:**
**错误一:**

\*\* 解决方法:缺了这个sqlite3这个包,我们就安装它\*\*
```
<pre class="calibre10">```
yum install sqlite<span class="token1">-</span>devel
```
```

**错误二:**

\*\* 解决方法:它说没有找到这个文件夹,我们就给它一个\*\*
```
<pre class="calibre10">```
cp <span class="token1">-</span>frp <span class="token1">/</span>usr<span class="token1">/</span>lib64<span class="token1">/</span>libldap<span class="token1">*</span> <span class="token1">/</span>usr<span class="token1">/</span>lib<span class="token1">/</span>
```
```
**错误三:**

**解决方法:缺了这个oniguruma这个包,我们就安装它**
```
<pre class="calibre10">```
yum install oniguruma
```
```

结果不行,去查看了官方更新日志 发现mbsting 需要oniguruma6.9.4
[git的基本用户和实例,git与github的区别](https://www.cnblogs.com/alliancehacker/p/12285486.html)
```
<pre class="calibre10">```
#从github中下载源码
git clone https<span class="token3">:</span><span class="token1">/</span><span class="token1">/</span>github<span class="token3">.</span>com<span class="token1">/</span>kkos<span class="token1">/</span>oniguruma
```
```

```
<pre class="calibre10">```
官方安装步骤 possibly undefined macro<span class="token3">:</span> AM_INIT_AUTOMAKE 需要先 #autoreconf install
#要删除之前安的
yum remove onigurma<span class="token1">*</span>
cd oniguruma<span class="token1">/</span>
autoreconf <span class="token1">-</span>vfi
<span class="token3">.</span><span class="token1">/</span>configure
make
make install
```
```

**运行./configure,直接出现下图**

### 编译安装(安装要花一点时间)
```
<pre class="calibre10">```
make <span class="token1">&&</span> make install
```
```

**映射全局命令**
```
<pre class="calibre10">```
ln <span class="token1">-</span>s <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>php<span class="token1">/</span>sbin<span class="token">/* /usr/local/sbin/
ln -s /usr/local/php/bin/* /usr/local/bin/
</span>
```
```
**输入 php -v ,出现下图,这就安装成功了**

**删除php7.4**
```
<pre class="calibre10">```
rm <span class="token1">-</span>rf <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>php <span class="token1">/</span>bin<span class="token1">/</span>php <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>sbin<span class="token1">/</span>php<span class="token1">-</span>fpm <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>bin<span class="token1">/</span>php <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>bin<span class="token1">/</span>pear <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>bin<span class="token1">/</span>peardev <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>bin<span class="token1">/</span>pecl <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>bin<span class="token1">/</span>phar <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>bin<span class="token1">/</span>phar<span class="token3">.</span>phar <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>bin<span class="token1">/</span>php<span class="token1">-</span>cgi <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>bin<span class="token1">/</span>php<span class="token1">-</span>config <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>bin<span class="token1">/</span>phpdbg <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>bin<span class="token1">/</span>phpize
```
```
## 3.LNMP(一键安装包)仅安装(php7.4)
**参考网站**
<https://lnmp.org/>
出官网找到有php7.4的版本,是lnmp1.7才开始支持php7.4,但不是稳定版,如果是用于生产环境还是建议用稳的版本
```
<pre class="calibre10">```
wget http<span class="token3">:</span><span class="token1">/</span><span class="token1">/</span>soft<span class="token3">.</span>vpser<span class="token3">.</span>net<span class="token1">/</span>lnmp<span class="token1">/</span>lnmp1<span class="token3">.</span><span class="token6">7</span>beta<span class="token3">.</span>tar<span class="token3">.</span>gz
# 解压
tar <span class="token1">-</span>zxvf lnmp1<span class="token3">.</span><span class="token6">7</span>beta<span class="token3">.</span>tar<span class="token3">.</span>gz
cd lnmp1<span class="token3">.</span><span class="token6">7</span>
<span class="token3">.</span><span class="token1">/</span>install<span class="token3">.</span>sh
```
```

**输入0,不安装DataBase(数据库)**

输入10,安装php7.4这个版本

\*\* 可以选择不安装、Jemalloc或TCmalloc,输入对应序号回车,直接回车为默认为不安装\*\*

脚本会自动下载安装php7.4

**LNMP相关软件安装目录**
```
<pre class="calibre10">```
Nginx 目录<span class="token3">:</span> <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>nginx<span class="token1">/</span>
MySQL 目录 <span class="token3">:</span> <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>mysql<span class="token1">/</span>
MySQL数据库所在目录:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>mysql<span class="token1">/</span>var<span class="token1">/</span>
MariaDB 目录 <span class="token3">:</span> <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>mariadb<span class="token1">/</span>
MariaDB数据库所在目录:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>mariadb<span class="token1">/</span>var<span class="token1">/</span>
PHP目录 <span class="token3">:</span> <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>php<span class="token1">/</span>
多PHP版本目录 <span class="token3">:</span> <span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>php5<span class="token3">.</span><span class="token6">5</span><span class="token1">/</span> 其他版本前面<span class="token6">5.5</span>的版本号换成其他即可
PHPMyAdmin目录 <span class="token3">:</span> <span class="token6">0.9</span>版本为<span class="token1">/</span>home<span class="token1">/</span>wwwroot<span class="token1">/</span>phpmyadmin<span class="token1">/</span> <span class="token6">1.0</span>及以后版本为 <span class="token1">/</span>home<span class="token1">/</span>wwwroot<span class="token1">/</span>default<span class="token1">/</span>phpmyadmin<span class="token1">/</span> 强烈建议将此目录重命名为其不容易猜到的名字。phpmyadmin可自己从官网下载新版替换。
默认网站目录 <span class="token3">:</span> <span class="token6">0.9</span>版本为 <span class="token1">/</span>home<span class="token1">/</span>wwwroot<span class="token1">/</span> <span class="token6">1.0</span>及以后版本为 <span class="token1">/</span>home<span class="token1">/</span>wwwroot<span class="token1">/</span>default<span class="token1">/</span>
Nginx日志目录:<span class="token1">/</span>home<span class="token1">/</span>wwwlogs<span class="token1">/</span>
<span class="token1">/</span>root<span class="token1">/</span>vhost<span class="token3">.</span>sh添加的虚拟主机配置文件所在目录:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>nginx<span class="token1">/</span>conf<span class="token1">/</span>vhost<span class="token1">/</span>
PureFtpd 目录:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>pureftpd<span class="token1">/</span>
PureFtpd web管理目录: <span class="token6">0.9</span>版为<span class="token1">/</span>home<span class="token1">/</span>wwwroot<span class="token1">/</span>default<span class="token1">/</span>ftp<span class="token1">/</span> <span class="token6">1.0</span>版为 <span class="token1">/</span>home<span class="token1">/</span>wwwroot<span class="token1">/</span>default<span class="token1">/</span>ftp<span class="token1">/</span>
Proftpd 目录:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>proftpd<span class="token1">/</span>
Redis 目录:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>redis<span class="token1">/</span>
```
```
**LNMP相关配置文件位置**
```
<pre class="calibre10">```
Nginx主配置<span class="token3">(</span>默认虚拟主机<span class="token3">)</span>文件:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>nginx<span class="token1">/</span>conf<span class="token1">/</span>nginx<span class="token3">.</span>conf
添加的虚拟主机配置文件:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>nginx<span class="token1">/</span>conf<span class="token1">/</span>vhost<span class="token1">/</span>域名<span class="token3">.</span>conf
MySQL配置文件:<span class="token1">/</span>etc<span class="token1">/</span>my<span class="token3">.</span>cnf
PHP配置文件:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>php<span class="token1">/</span>etc<span class="token1">/</span>php<span class="token3">.</span>ini
php<span class="token1">-</span>fpm配置文件:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>php<span class="token1">/</span>etc<span class="token1">/</span>php<span class="token1">-</span>fpm<span class="token3">.</span>conf
PureFtpd配置文件:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>pureftpd<span class="token1">/</span>pure<span class="token1">-</span>ftpd<span class="token3">.</span>conf <span class="token6">1.3</span>及更高版本:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>pureftpd<span class="token1">/</span>etc<span class="token1">/</span>pure<span class="token1">-</span>ftpd<span class="token3">.</span>conf
PureFtpd MySQL配置文件:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>pureftpd<span class="token1">/</span>pureftpd<span class="token1">-</span>mysql<span class="token3">.</span>conf
Proftpd配置文件:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>proftpd<span class="token1">/</span>etc<span class="token1">/</span>proftpd<span class="token3">.</span>conf <span class="token6">1.2</span>及之前版本为<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>proftpd<span class="token1">/</span>proftpd<span class="token3">.</span>conf
Proftpd 用户配置文件:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>proftpd<span class="token1">/</span>etc<span class="token1">/</span>vhost<span class="token1">/</span>用户名<span class="token3">.</span>conf
Redis 配置文件:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>redis<span class="token1">/</span>etc<span class="token1">/</span>redis<span class="token3">.</span>conf
```
```
**LNMPA相关目录文件位置**
```
<pre class="calibre10">```
Apache目录:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>apache<span class="token1">/</span>
Apache配置文件:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>apache<span class="token1">/</span>conf<span class="token1">/</span>httpd<span class="token3">.</span>conf
Apache虚拟主机配置文件目录:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>apache<span class="token1">/</span>conf<span class="token1">/</span>vhost<span class="token1">/</span>
Apache默认虚拟主机配置文件:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>apache<span class="token1">/</span>conf<span class="token1">/</span>extra<span class="token1">/</span>httpd<span class="token1">-</span>vhosts<span class="token3">.</span>conf
虚拟主机配置文件名称:<span class="token1">/</span>usr<span class="token1">/</span>local<span class="token1">/</span>apache<span class="token1">/</span>conf<span class="token1">/</span>vhost<span class="token1">/</span>域名<span class="token3">.</span>conf
```
```
**LNMP状态管理命令:**
LNMP 1.2+状态管理: lnmp {start|stop|reload|restart|kill|status}
LNMP 1.2+各个程序状态管理: lnmp {nginx|mysql|mariadb|php-fpm|pureftpd} {start|stop|reload|restart|kill|status}
LNMP 1.1状态管理: /root/lnmp {start|stop|reload|restart|kill|status}
Nginx状态管理:/etc/init.d/nginx {start|stop|reload|restart}
MySQL状态管理:/etc/init.d/mysql {start|stop|restart|reload|force-reload|status}
Memcached状态管理:/etc/init.d/memcached {start|stop|restart}
PHP-FPM状态管理:/etc/init.d/php-fpm {start|stop|quit|restart|reload|logrotate}
PureFTPd状态管理: /etc/init.d/pureftpd {start|stop|restart|kill|status}
ProFTPd状态管理: /etc/init.d/proftpd {start|stop|restart|reload}
Redis状态管理: /etc/init.d/redis {start|stop|restart|kill}
多PHP版本状态管理:/etc/init.d/php-fpm5.5 {start|stop|quit|restart|reload|logrotate} 前面5.5为对应的PHP版本,其他版本自行替换。
如重启LNMP,1.2+输入命令:lnmp restart 即可;单独重启mysql:/etc/init.d/mysql restart 也可以 lnmp mysql restart ,两个是一样的。
**LNMPA状态管理命令:**
LNMPA 1.2+状态管理: lnmp {start|stop|reload|restart|kill|status}
LNMPA 1.2+各个程序状态管理: lnmp {httpd|mysql|mariadb|pureftpd} {start|stop|reload|restart|kill|status}
LNMPA1.1状态管理: /root/lnmpa {start|stop|reload|restart|kill|status}
Nginx状态管理:/etc/init.d/nginx {start|stop|reload|restart}
MySQL状态管理:/etc/init.d/mysql {start|stop|restart|reload|force-reload|status}
Memcached状态管理:/etc/init.d/memcached {start|stop|restart}
PureFTPd状态管理: /etc/init.d/pureftpd {start|stop|restart|kill|status}
ProFTPd状态管理: /etc/init.d/proftpd {start|stop|restart|reload}
Apache状态管理:/etc/init.d/httpd {start|stop|restart|graceful|graceful-stop|configtest|status}
**LAMP状态管理命令:**
LAMP 1.2+状态管理: lnmp {start|stop|reload|restart|kill|status}
LAMP 1.2+各个程序状态管理: lnmp {httpd|mysql|mariadb|pureftpd} {start|stop|reload|restart|kill|status}
- php更新内容
- 其他
- empty、isset、is_null
- echo 输出bool值
- if真假情况
- 常量
- define与const(php5.3) 类常量
- 递归
- 单元测试
- 面向对象
- 全局变量域超全局变量
- php网络相关
- 支持的协议和封装协议(如http,php://input)
- 上下文(Context)选项和参数
- 过滤器
- http请求及模拟登录
- socket
- streams
- swoole
- 超全局变量
- $_ENV :存储了一些系统的环境变量
- $_COOKIE
- $_SESSION
- $_FILES
- $_SERVER
- 正则
- php正则函数
- 去除文本中的html、xml的标签
- 特殊符号
- \r\n
- 模式修正符
- 分组
- 断言
- 条件表达式
- 递归表达式 (?R)
- 固化分组
- 正则例子
- 框架
- 自动加载spl_autoload_register
- 时间函数
- 文件操作
- 文件的上传下载
- 常见的mimi类型
- 文件断点续传
- 下载文件防盗链
- 破解防盗链
- 无限分类
- 短信验证码
- 短信宝
- 视频分段加载
- phpDoc注释
- 流程控制代替语法
- 三元运算
- @错误抑制符
- 字符编码
- PHP CLI模式开发
- 配置可修改范围
- CGI、FastCGI和PHP-FPM关系图解
- No input file specified的解决方法
- SAPI(PHP常见的四种运行模式)
- assert断言
- 类基础
- 类的三大特性:封装,继承,多态
- 魔术方法
- 辅助查询(*)
- extends继承
- abstract 抽象类
- interface 接口(需要implements实现)
- 抽象类和接口的区别
- 多态
- static
- final
- serialize与unserialize
- instanceof 判断后代子类
- 类型约束
- clone克隆
- ::的用法
- new self()与new static()
- this、self、static、parent、super
- self、static、parent:后期静态绑定
- PHP的静态变量
- php导入
- trait
- 动态调用类方法
- 参数及类型申明
- 方法的重载覆盖
- return $a && $b
- 设计思想
- 依赖注入与依赖倒置
- 创建型模式(创建类对象)
- (*)单例模式
- (*)工厂模式
- 原型模式(在方法里克隆this)
- 创建者模式
- 结构型模式
- 适配器模式(Adapter)
- 桥接模式
- 装饰模式
- 组合模式
- 外观模式(门面(Facade)模式)
- 享元模式
- 代理模式
- 行为型模式
- (*)观察者模式
- (*)迭代器模式(Iterator)
- 模板方法模式 Template
- 命令模式(Command)
- 中介者模式(Mediator)
- 状态模式(State)
- 职责链模式 (Chainof Responsibility)
- 策略模式(Strategy)
- 已知模式-备忘录模式(Memento)
- 深度模式-解释器模式(Interpreter)
- 深度模式-访问者模式(Visitor)
- (*)注册树(注射器、注册表)模式
- 函数参考
- 影响 PHP 行为的扩展
- APC扩展(过时)
- APCu扩展
- APD扩展(过时)
- bcompiler扩展(过时)
- BLENC扩展 (代码加密 实验型)
- Componere扩展(7.1+)
- 错误处理扩展(PHP 核心)
- FFI扩展
- htscanner扩展
- inclued扩展
- Memtrack扩展
- OPcache扩展(5.5.0内部集成)
- Output Control扩展(核心)
- PHP Options/Info扩展(核心)
- phpdbg扩展(5.6+内部集成)
- runkit扩展
- runkit7扩展
- scream扩展
- uopz扩展
- Weakref扩展
- WinCache扩展
- Xhprof扩展
- 音频格式操作
- ID3
- KTaglib
- oggvorbis
- OpenAL
- 身份认证服务
- KADM5
- Radius
- 针对命令行的扩展
- Ncurses(暂无人维护)
- Newt(暂无人维护)
- Readline
- 压缩与归档扩展
- Bzip2
- LZF
- Phar
- Rar
- Zip
- Zlib
- 信用卡处理
- 加密扩展
- Crack(停止维护)
- CSPRNG(核心)
- Hash扩展(4.2内置默认开启、7.4核心)
- Mcrypt(7.2移除)
- Mhash(过时)
- OpenSSL(*)
- 密码散列算法(核心)
- Sodium(+)
- 数据库扩展
- 数据库抽象层
- 针对各数据库系统对应的扩展
- 日期与时间相关扩展
- Calendar
- 日期/时间(核心)
- HRTime(*)
- 文件系统相关扩展
- Direct IO
- 目录(核心)
- Fileinfo(内置)
- 文件系统(核心)
- Inotify
- Mimetype(过时)
- Phdfs
- Proctitle
- xattr
- xdiff
- 国际化与字符编码支持
- Enchant
- FriBiDi
- Gender
- Gettext
- iconv(内置默认开启)
- intl
- 多字节字符串(mbstring)
- Pspell
- Recode(将要过时)
- 图像生成和处理
- Cairo
- Exif
- GD(内置)
- Gmagick
- ImageMagick
- 邮件相关扩展
- Cyrus
- IMAP
- Mail(核心)
- Mailparse
- vpopmail(实验性 )
- 数学扩展
- BC Math
- GMP
- Lapack
- Math(核心)
- Statistics
- Trader
- 非文本内容的 MIME 输出
- FDF
- GnuPG
- haru(实验性)
- Ming(实验性)
- wkhtmltox(*)
- PS
- RPM Reader(停止维护)
- RpmInfo
- XLSWriter Excel操作(*)
- 进程控制扩展
- Eio
- Ev
- Expect
- Libevent
- PCNTL
- POSIX
- 程序执行扩展(核心)
- parallel
- pthreads(*)
- pht
- Semaphore
- Shared Memory
- Sync
- 其它基本扩展
- FANN
- GeoIP(*)
- JSON(内置)
- Judy
- Lua
- LuaSandbox
- Misc(核心)
- Parsekit
- SeasLog(-)
- SPL(核心)
- SPL Types(实验性)
- Streams(核心)
- Swoole(*)
- Tidy扩展
- Tokenizer
- URLs(核心)
- V8js(*)
- Yaml
- Yaf
- Yaconf(核心)
- Taint(检测xss字符串等)
- Data Structures
- 其它服务
- 网络(核心)
- cURL(*)
- Event(*)
- chdb
- FAM
- FTP
- Gearman
- Gopher
- Gupnp
- Hyperwave API(过时)
- LDAP(+)
- Memcache
- Memcached(+)
- mqseries
- RRD
- SAM
- ScoutAPM
- SNMP
- Sockets
- SSH2
- Stomp
- SVM
- SVN(试验性的)
- TCP扩展
- Varnish
- YAZ
- YP/NIS
- 0MQ(ZeroMQ、ZMQ)消息系统
- ZooKeeper
- 搜索引擎扩展
- mnoGoSearch
- Solr
- Sphinx
- Swish(实验性)
- 针对服务器的扩展
- Apache
- FastCGI 进程管理器
- IIS
- NSAPI
- Session 扩展
- Msession
- Sessions
- Session PgSQL
- 文本处理
- BBCode
- CommonMark(markdown解析)
- Parle
- PCRE( 核心)
- POSIX Regex
- ssdeep
- 字符串(核心)
- 变量与类型相关扩展
- 数组(核心)
- 类/对象(核心)
- Classkit(未维护)
- Ctype
- Filter扩展
- 函数处理(核心)
- quickhash扩展
- 反射扩展(核心)
- Variable handling(核心)
- Web 服务
- OAuth
- SCA(实验性)
- SOAP
- Yar
- XML-RPC(实验性)
- Windows 专用扩展
- COM
- win32ps
- win32service
- XML 操作
- DOM(内置,默认开启)
- libxml(内置 默认开启)
- SDO(停止维护)
- SDO-DAS-Relational(试验性的)
- SDO DAS XML
- SimpleXML(内置,5.12+默认开启)
- WDDX
- XMLDiff
- XML 解析器(Expat 解析器 默认开启)
- XMLReader(5.1+内置默认开启)
- XMLWriter(5.1+内置默认开启)
- XSL(内置)
- 图形用户界面(GUI) 扩展
- UI
- 预定义类
- PHP SPL(PHP 标准库)
- 数据结构
- SplDoublyLinkedList(双向链表)
- SplStack(栈 先进后出)
- SplQueue(队列)
- SplHeap(堆)
- SplMaxHeap(最大堆)
- SplMinHeap(最小堆)
- SplPriorityQueue(堆之优先队列)
- SplFixedArray(阵列【数组】)
- SplObjectStorage(映射【对象存储】)
- 迭代器
- DirectoryIterator类
- 文件处理
- SplFileInfo
- SplFileObject
- SplTempFileObject
- 接口 interface
- Countable
- OuterIterator
- RecursiveIterator
- SeekableIterator
- 异常
- 各种类及接口
- SplSubject
- SplObserver
- ArrayObject(将数组作为对象操作)
- SPL 函数
- 预定义接口
- Traversable(遍历)接口
- Iterator(迭代器)接口
- IteratorAggregate(聚合式迭代器)接口
- ArrayAccess(数组式访问)接口
- Serializable 序列化接口
- JsonSerializable
- Closure 匿名函数(闭包)类
- Generator生成器类
- 生成器(php5.5+)
- 反射
- 一、反射(reflection)类
- 二、Reflector 接口
- ReflectionClass 类报告了一个类的有关信息。
- ReflectionFunctionAbstract
- ReflectionParameter 获取函数或方法参数的相关信息
- ReflectionProperty 类报告了类的属性的相关信息。
- ReflectionClassConstant类报告有关类常量的信息。
- ReflectionZendExtension 类返回Zend扩展相关信息
- ReflectionExtension 报告了一个扩展(extension)的有关信息。
- 三、ReflectionGenerator类用于获取生成器的信息
- 四、ReflectionType 类用于获取函数、类方法的参数或者返回值的类型。
- 五、反射的应用场景
- git
- Git代码同时上传到GitHub和Gitee(码云)
- Git - 多人协同开发利器,团队协作流程规范与注意事项
- 删除远程仓库的文件
- 创建composer项目
- composer安装及设置
- composer自动加载讲解
- phpsdudy的composer操作
- swoole笔记
- 安装及常用Cli操作
- TCP
- 4种回调函数的写法
- phpRedis
- API
- API详细
- redis DB 概念:
- 通用命令:rawCommand
- Connection
- Server
- List
- Set
- Zset
- Hash
- string
- Keys
- 事物
- 发布订阅
- 流streams
- Geocoding 地理位置
- lua脚本
- Introspection 自我检测
- biMap
- 原生
- php-redis 操作类 封装
- redis 队列解决秒杀解决超卖:
- Linux
- Centos8(Liunx) 中安装PHP7.4 的三种方法和删除它的三种方法
- 权限设计
- ACL
- RBAC
- RBAC0
- RBAC1
- RBAC2
- RBAC3
- 例子
- ABAC 基于属性的访问控制
- 总结:SAAS后台权限设计案例分析
- casbin-权限管理框架
- 开始使用
- casbinAPI
- Think-Casbin
- 单点登录(SSO)
- OAuth授权
- OAuth 2.0 的四种方式
- 更新令牌
- 例子:第三方登录
- 微服务架构下的统一身份认证和授权
- 杂项
- SSL证书
- sublime Emmet的快捷语法
- 免费翻译接口
- 免费空间
- xss过滤
- HTML Purifier文档
- xss例子
- 实用小函数
- PHP操作Excel
- 架构师必须知道的26项PHP安全实践
- 模版布局
- smarty模版
- blade
- twig
- 大佬博客
- 优化
- 缓存
- opcache
- memcache
- 数据库
- 主从分布
- 数据库设计
- 笔记
- 配置
- nginx 主从配置
- nginx 负载均衡的配置
- 手动搭建Redis集群和MySQL主从同步(非Docker)
- Redis Cluster集群
- mysql主从同步
- 用安卓手机搭建 web 服务器
- 软件选择
- 扩展库列表
- 代码审计
- 漏洞挖掘的思路
- 命令注入
- 代码注入
- XSS 反射型漏洞
- XSS 存储型漏洞
- 本地包含与远程包含
- sql注入
- 函数
- 注释
- 步骤
- information_schema
- sql注入的分类
- 实战
- 防御
- CSRF 跨站请求伪造
- 计动态函数执行与匿名函数执行
- unserialize反序列化漏洞
- 覆盖变量漏洞
- 文件管理漏洞
- 文件上传漏洞
- 跳过登录
- URL编码对照表
- 浏览器插件开发
- 插件推荐
- 扩展文件manifest.json
- 不可视的background(常驻)页面
- 可视页面browser actions与page actions及八种展示方式
- 使用chrome.xxx API
- Google Chrome扩展与Web页面/服务器之间的交互
- Google Chrome扩展中的页面之间的数据通信
- inject-script
- chromeAPI
- pageAction
- alarms
- chrome.tabs
- chrome.runtime
- chrome.webRequest
- chrome.window
- chrome.storage
- chrome.contextMenus
- chrome.devtools
- chrome.extension
- 分类
- homepage_url 开发者或者插件主页
- 5种类型的JS对比及消息通信
- 其它补充
- 前端、移动端
- html5
- meta标签
- flex布局
- javascript
- 获取js对象所有方法
- dom加载
- ES6函数写法
- ES6中如何导入和导出模块
- 数组的 交集 差集 补集 并集
- bootstrap
- class速查
- 常见data属性
- 开源项目
- 会员 数据库表设计
- 程序执行
- 开发总结
- API接口
- API接口设计
- json转化
- app接口