当前位置:网站首页>使用php脚本查看已开启的扩展
使用php脚本查看已开启的扩展
2022-06-25 11:45:00 【lxw1844912514】
正式线phpinfo()函数被禁用,但又想知道PHP安装了那些扩展,怎么办呢?
php安装时会将扩展包编译进去,对于一个正在运行中的数据库,查看php的扩展开启状况,
第一种:是通过配置文件查看。
第二种:在 PHP-FPM 的网页中,我们可以通过 phpinfo() 函数来查看当前 PHP 的状态及扩展相关信息。
第三种:在 CLI 命令行脚本中,我们可以使用 php -m 命令来查看已加载的扩展。
第四种:使用php内置函数来查看,通过脚本输出来查看,代码如下:
<?php
print_r(get_loaded_extensions());
?>通过get_loaded_extensions函数可以返回php扩展开启情况的一个数组,然后可以打印出来
通过查看源代码可以清晰地看出扩展的开启情况:

另外, PHP 也为我们提供了在动态运行期间可以查看扩展状态的函数。
查看是否已经加载了扩展
echo extension_loaded("redis");
// 1非常简单的一个函数,它的作用就是检查一个扩展是否已经加载。它返回的是一个布尔值,当扩展已经加载则返回 true ,如果扩展没有加载,则返回 false 。

边栏推荐
- WebRTC Native M96 基础Base模块介绍之网络相关的封装
- Ladder side tuning: the "wall ladder" of the pre training model
- SQL server saves binary fields to disk file
- ROS notes (06) - definition and use of topic messages
- 记一次有趣的逻辑SRC挖掘
- Is it safe to open a stock account on your mobile phone? Who can I open an account with?
- Using DBF of VFP to web salary query system
- Builder pattern
- Flink partition policy
- 按钮多次点击造成结果
猜你喜欢

ROS 笔记(06)— 话题消息的定义和使用

架构师为你揭秘在阿里、腾讯、美团工作的区别

RPC typical framework

Vulnérabilité à l'injection SQL (contournement)

Research on parallel computing architecture of meteorological early warning based on supercomputing platform

云原生数据湖以存储、计算、数据管理等能力通过信通院评测认证

Comment TCP gère - t - il les exceptions lors de trois poignées de main et de quatre vagues?

Idea uses the fast request interface for debugging

Countdownlatch source code analysis

SQL server saves binary fields to disk file
随机推荐
How TCP handles exceptions during three handshakes and four waves
客从何处来
Flink deeply understands the graph generation process (source code interpretation)
Under what circumstances will Flink combine operator chains to form operator chains?
quarkus saas动态数据源切换实现,简单完美
交易期货沪镍产品网上怎么开户
Startups must survive
Shichuang energy rushes to the scientific innovation board: it plans to raise 1.1 billion yuan, with an annual revenue of 700million yuan and a 36% decrease in net profit
JVM shutdown hook details
西山科技冲刺科创板:拟募资6.6亿 郭毅军夫妇有60%表决权
How far is it from the DBF of VFP to the web salary query system?
How to use the markdown editor
Vulnérabilité à l'injection SQL (contournement)
一个硬件工程师走过的弯路
兴业证券是国企吗?在兴业证券开户资金安全吗?
SMS verification before deleting JSP
基于超算平台气象预警并行计算架构研究
牛客网:分糖果问题
翌圣生物冲刺科创板:25%收入来自新冠产品销售 拟募资11亿
What is the development history, specific uses and structure of the chip