当前位置:网站首页>使用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 。

边栏推荐
- An interesting logic SRC mining
- 手机上股票开户安全吗?找谁可以开户啊?
- Old ou, a fox friend, has had a headache all day. The VFP format is always wrong when it is converted to JSON format. It is actually caused by disordered code
- Shichuang Energy sprint Technology Innovation Board: le chiffre d'affaires annuel prévu de 1,1 milliard de RMB est de 0,7 milliard de RMB, en baisse de 36%
- Presto Web UI introduction
- Record the process of submitting code to openharmony once
- 基于超算平台气象预警并行计算架构研究
- VFP calls the command line image processing program, and adding watermark is also available
- Redis雪崩、穿透和击穿是什么?
- TCP如何处理三次握手和四次挥手期间的异常
猜你喜欢

Actual combat summary of Youpin e-commerce 3.0 micro Service Mall project

Leetcode 1249. Remove invalid brackets (awesome, finally made)

Recommend a virtual machine software available for M1 computer

Share 7 immortal wallpaper websites, let the new wallpaper give you a little joy, and don't fall into the repetition year after year.

Redis雪崩、穿透和击穿是什么?

Niuke: rotation array

Using DBF of VFP to web salary query system

Nacos installation and use

Oracle Spatial creating spatial tables

TCP如何處理三次握手和四次揮手期間的异常
随机推荐
Two ways of redis persistence -- detailed explanation of RDB and AOF
西山科技冲刺科创板:拟募资6.6亿 郭毅军夫妇有60%表决权
Semaphore source code analysis
Ladder side tuning: the "wall ladder" of the pre training model
An interesting logic SRC mining
Eureka accesses the console and reports an error: whitelabel error page
Yisheng biological sprint scientific innovation board: 25% of the revenue comes from the sales of new crown products, and it is planned to raise 1.1 billion yuan
quarkus saas动态数据源切换实现,简单完美
Thingspanel releases Internet of things mobile client (multiple pictures)
剑指 Offer II 091. 粉刷房子 : 状态机 DP 运用题
Deeply understand Flink SQL execution process based on flink1.12
Recommend a virtual machine software available for M1 computer
Detailed explanation of Flink checkpoint specific operation process and summary of error reporting and debugging methods
Dynamic programming to solve stock problems (Part 1)
VFP a picture processing library, simple and easy to use, free of charge, worth recommending
Spark runs wordcount (case 1)
JS indexof() always returns -1
客从何处来
Redis雪崩、穿透和击穿是什么?
建造者模式