How can you find out what the PHP installation path is on a server?
Asked
Active
Viewed 1.3e+01k times
40
-
1What specifically are you looking for? The `mod_php` libraries? The PHP run-time modules? Or, the PHP interpreter? – PaulProgrammer May 13 '14 at 20:06
-
“My question is just above, but this lines is because, I can't ask very small question.” Now you can! – Giacomo1968 May 13 '14 at 20:07
-
3You'd think a relatively high rep user would know how to ask a question? – The Blue Dog May 13 '14 at 20:09
-
2Check this http://serverfault.com/q/237695 – Wahyu Kristianto May 13 '14 at 20:13
-
2[`phpinfo();` and `php -i` will help you](http://stackoverflow.com/questions/8684609/dude-wheres-my-php-ini). – admdrew May 13 '14 at 20:15
2 Answers
77
In your terminal run the following:
which php
http://unixhelp.ed.ac.uk/CGI/man-cgi?which
Running PHP's https://php.net/phpinfo should tell you more about the PHP that's currently running your scripts.
<?php phpinfo();
put this line into a file and run it on a browser.

Reejesh PK
- 658
- 1
- 11
- 27

tester
- 22,441
- 25
- 88
- 128
-
15This may or may not answer the OP question. If php is on the execution path, the location the binary is referenced may not be the install path. – PaulProgrammer May 13 '14 at 20:07
-
Adding to @PaulProgrammer , we need to check environment variables, it might be pointing to something different, we need to check the 'Path' variable in environment variables in windows. – Reejesh PK Dec 20 '20 at 14:13