一,查看安装配置信息
[liuhongdi@img ~]$ /usr/local/soft/php8.2.5/bin/php -i
相当于执行:
[liuhongdi@img ~]$ /usr/local/soft/php8.2.5/bin/php -r "phpinfo();”
二,列出开启的扩展模块:
[liuhongdi@img ~]$ /usr/local/soft/php8.2.5/bin/php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
fileinfo
filter
ftp
gd
gettext
hash
iconv
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
random
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sysvsem
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache
三,查看配置文件的信息
[liuhongdi@img ~]$ /usr/local/soft/php8.2.5/bin/php --ini
Configuration File (php.ini) Path: /usr/local/soft/php8.2.5/etc
Loaded Configuration File: /usr/local/soft/php8.2.5/etc/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
四,查看php的版本:
[liuhongdi@img ~]$ /usr/local/soft/php8.2.5/bin/php -v
PHP 8.2.5 (cli) (built: May 10 2023 14:51:39) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.5, Copyright (c) Zend Technologies
with Zend OPcache v8.2.5, Copyright (c), by Zend Technologies
五,查看安装目录:
[liuhongdi@img ~]$ /usr/local/soft/php8.2.5/bin/php-config --prefix
/usr/local/soft/php8.2.5
六,查看扩展模块的存放目录
[liuhongdi@img ~]$ /usr/local/soft/php8.2.5/bin/php-config --extension-dir
/usr/local/soft/php8.2.5/lib/php/extensions/no-debug-non-zts-20220829
说明:刘宏缔的架构森林—专注it技术的博客,
网站:https://blog.imgtouch.com
原文: https://blog.imgtouch.com/index.php/2023/09/02/php-ming-ling-hang-de-chang-yong-li-zi-php-8-2-5/
代码: https://github.com/liuhongdi/ 或 https://gitee.com/liuhongdi
说明:作者:刘宏缔 邮箱: [email protected]
七,查看配置项
[liuhongdi@img ~]$ /usr/local/soft/php8.2.5/bin/php-config --configure-options
--prefix=/usr/local/soft/php8.2.5 --with-config-file-path=/usr/local/soft/php8.2.5/etc --with-curl --with-freetype --enable-gd --with-jpeg --with-gettext --with-kerberos --with-libdir=lib64 --with-libxml --with-mysqli --with-openssl --with-pdo-mysql --with-pdo-sqlite --with-pear --enable-sockets --with-mhash --with-ldap-sasl --with-xsl --with-zlib --with-zip -with-bz2 --with-iconv --enable-fpm --enable-pdo --enable-bcmath --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-ftp --with-xpm --enable-xml --enable-sysvsem --enable-cli --enable-intl --enable-calendar --enable-static --enable-ctype --enable-mysqlnd --enable-session
八,查看版本(仅输出版本号)
[liuhongdi@img ~]$ /usr/local/soft/php8.2.5/bin/php-config --version
8.2.5
标签:8.2,--,soft,php8.2,enable,命令行,php,local
From: https://www.cnblogs.com/architectforest/p/17674263.html