36

How can you find out what the PHP installation path is on a server?

Oldskool
  • 33,525
  • 7
  • 51
  • 64
Oto Shavadze
  • 37,634
  • 51
  • 140
  • 215

2 Answers2

69

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
  • 578
  • 1
  • 9
  • 23
tester
  • 21,160
  • 23
  • 84
  • 122
  • 15
    This 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
22

In a command prompt, type

which php

whereis php

Abhilash Muthuraj
  • 1,878
  • 8
  • 29
  • 48