40

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

Oldskool
  • 34,211
  • 7
  • 53
  • 66
Oto Shavadze
  • 40,603
  • 55
  • 152
  • 236

2 Answers2

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
  • 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
27

In a command prompt, type

which php

whereis php

Abhilash Muthuraj
  • 2,008
  • 9
  • 34
  • 48