一,用-i参数
[liuhongdi@img ~]$ /usr/local/soft/php8.2.5/bin/php -i | grep configure
Configure Command => './configure' '--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’
二,用php-config
[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
三,直接执行phpinfo()函数:
[liuhongdi@img ~]$ /usr/local/soft/php8.2.5/bin/php -r "phpinfo();" | grep Configure
Configure Command => './configure' '--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'
四,查看安装目录下的build-defs.h文件
[liuhongdi@img ~]$ more /usr/local/soft/php8.2.5/include/php/main/build-defs.h
/*
+----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| https://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Stig Sæther Bakken <[email protected]> |
+----------------------------------------------------------------------+
*/
#define CONFIGURE_COMMAND " './configure' '--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-mbr
egex' '--enable-mbstring' '--enable-opcache' '--enable-pcntl' '--enable-shmop' '--enable-soap' '--enable-ftp' '--with-xpm' '--enable-xml' '--enable-sysvsem' '--enable-cli' '--ena
ble-intl' '--enable-calendar' '--enable-static' '--enable-ctype' '--enable-mysqlnd' '--enable-session'"
#define PHP_ODBC_CFLAGS ""
#define PHP_ODBC_LFLAGS ""
#define PHP_ODBC_LIBS ""
...
说明:刘宏缔的架构森林—专注it技术的博客,
网站:https://blog.imgtouch.com
原文: https://blog.imgtouch.com/index.php/2023/09/02/php-zha-kan-an-zhuang-shi-de-bian-yi-can-shu-php-8-2-5/
代码: https://github.com/liuhongdi/ 或 https://gitee.com/liuhongdi
说明:作者:刘宏缔 邮箱: [email protected]
五,查看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
标签:8.2,--,soft,php8.2,编译,enable,php,local
From: https://www.cnblogs.com/architectforest/p/17674260.html