Wednesday, February 26, 2014

Find the php.ini or php installed path in windows from command line prompt

How to find .ini file OR php path OR php version OR any other details of PHP.

If you installed  PHP  in windows directly or using webplotform installer.

Open command prompt and go to C Drive type

C:\> php -v

The result will be like this in my system, it may differ to you based on PHP version

PHP 5.4.24 (cli) (built: Jan  8 2014 20:26:10)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

C:\>php --ini

Configuration File (php.ini) Path: C:\Windows
Loaded Configuration File:         C:\Program Files (x86)\iis express\PHP\v5.4\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

If you want search/find using particular key word you can use this command

C:\>php -i | findstr php.ini

Configuration File (php.ini) Path => C:\Windows
Loaded Configuration File => C:\Program Files (x86)\iis express\PHP\v5.4\php.ini

C:\>php -i | findstr version

System => Windows .........
iconv library version => 1.14
json version => 1.2.1
libmbfl version => 1.3.2
mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.
Multibyte regex (oniguruma) version => 4.7.1
Client API version => mysqlnd 5.0.10 - 20111026 - $Id: 2d.............. $
Client API library version => mysqlnd 5.0.10 - 20111026 - $Id: 2d........ $
Client API version => mysqlnd 5.0.10 - 20111026 - $Id: 2d................$
Phar EXT version => 2.0.1
Phar API version => 1.1.1
core library version => xmlrpc-epi v. 0.51
php extension version => 0.51
Zip version => 1.11.0
Libzip version => 0.10.1