fourtwothree / daily-code

日常工作代码笔记
1 stars 0 forks source link

如何知道正在使用的是哪一个PHP及其路径? #5

Open fourtwothree opened 7 years ago

fourtwothree commented 7 years ago

which php - will locate the php executable (this should be the default php used by you)

If you want to find out the php version, then php -v will print the php version in the CLI and any Zend modules installed.

php -v  
PHP 5.6.30 (cli) (built: Mar 11 2017 09:56:27)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

If you want to find out the ini files included then php --ini will display th list of ini files loaded by the php module (this applies for the CLI version).

php --ini
Configuration File (php.ini) Path: /usr/local/etc/php/5.6
Loaded Configuration File:         /usr/local/etc/php/5.6/php.ini
Scan for additional .ini files in: /usr/local/etc/php/5.6/conf.d
Additional .ini files parsed:      /usr/local/etc/php/5.6/conf.d/ext-xdebug.ini