Hướng dẫn check php location windows

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

Nội dung chính

  • 2 Answers
  • Trending sort
  • Where is my PHP path?
  • Where is PHP directory in Linux?
  • How do I know if PHP is installed?
  • Where is PHP EXE on Windows?

Hướng dẫn check php location windows

Oldskool

33.7k7 gold badges51 silver badges64 bronze badges

asked May 13, 2014 at 20:04

Oto ShavadzeOto Shavadze

38.4k54 gold badges142 silver badges218 bronze badges

5

2 Answers

Sorted by: Reset to default

Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.

It falls back to sorting by highest score if no posts are trending.

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.

put this line into a file and run it on a browser.

Reejesh PK

5881 gold badge9 silver badges23 bronze badges

answered May 13, 2014 at 20:05

testertester

21.5k25 gold badges84 silver badges122 bronze badges

2

In a command prompt, type

which php

whereis php

answered May 13, 2014 at 20:07

4

I am using centos and I need to find out where is the php installation path is. Is there a command I can use to find that out. Thanks

asked Feb 19, 2011 at 20:02

I would recommend creating a new test.php files and inserting this code:


Then browse to test.php in a browser. This should give you a lot of information on php.

If you installed via an rpm also try

 rpm -ql php

or

 find / -name php.ini

answered Feb 19, 2011 at 20:07

pablopablo

3,0201 gold badge18 silver badges23 bronze badges

2

I'm not sure what you mean by install path, if you're talking about the binary 'which php' will probably work.

If you're referring to something else like the extension install dir and assuming your php was installed with RPMs, do a 'yum install php-devel' to get the php-config command. You can run it with no options to get a listing of everything it knows or you can request only certain info from it, here's some useful ones for your situation:

php-config --php-binary
php-config --extension-dir
php-config --include-dir

Also try running 'php -i' on the command line to get the output of phpinfo.

answered Feb 19, 2011 at 21:16

I believe best answer should be using linux shell command:

whereis php

answered Jun 19, 2020 at 9:59

My install is in

/etc/php.d/

and

/usr/include/php

But I'm not sure what you are trying to accomplish

answered Feb 19, 2011 at 20:08

Bart De VosBart De Vos

17.8k6 gold badges62 silver badges81 bronze badges

1

You can also use this command

php -i | grep "Loaded Configuration File"

answered Jan 23, 2017 at 16:49

DrakeDrake

1711 silver badge8 bronze badges

Where is my PHP path?

On Windows the default path for the php. ini file is the Windows directory. If you're using the Apache webserver, php. ini is first searched in the Apaches install directory, e.g. c:\program files\apache group\apache .

Where is PHP directory in Linux?

The default location for the php. ini file is: Ubuntu 16.04: /etc/php/7.0/apache2. CentOS 7: /etc/php.

How do I know if PHP is installed?

1. Type the following command, replacing [location] with the path to your PHP installation. 2. Typing php -v now shows the PHP version installed on your Windows system.

Where is PHP EXE on Windows?

Php.exe is located in a subfolder of the user's profile folder —common is C:\Users\USERNAME\AppData\Local\php7\. Known file sizes on Windows 10/8/7/XP are 28,739 bytes (57% of all occurrences) or 106,496 bytes. The program has a visible window.