Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-15-2007, 05:01 PM   #1
Registered: Sep 2006
Posts: 57

Rep: Reputation: 15
Linux Path Lookup: php where command

Is there a command that you can use to find where certain types of software is installed?

For example: php where

Thank you.
Old 04-15-2007, 06:24 PM   #2
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
Originally Posted by jCash
Is there a command that you can use to find where certain types of software is installed?

For example: php where

Thank you.
Your example will be hard to use as PHP is an enormous application. In addition, PHP has a lot of locations, so it depends on what you are looking for (for example, the php.ini is located in muliple places such as /etc/apache2/php/php.ini depending on the distro) Simple applications (such as ls) are easier to illustrate:
masterc@rackster ~ $ which ls
masterc@rackster ~ $ whereis ls
ls: /bin/ls /usr/bin/ls /usr/man/man1/ls.1.bz2 /usr/man/man1p/ls.1p.bz2 /usr/share/man/man1/ls.1.bz2 /usr/share/man/man1p/ls.1p.bz2
Now for PHP, it's a little more complicated:
masterc@rackster ~ $ which php
Returns the location of the PHP binary (which if that's what you need, great) but often it's not the PHP binary we want to know the location of, but where the php.ini is that the PHP is using (or Apache is using). It is defineable at the command line with a -c switch:
/usr/bin/php -c /wherever/i/want/php.ini
If you are wondering where Apache is looking, check in apache's conf directory (usually located in /etc/apache2/conf) for info on that (depends on your distro or how you installed it).




Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
php include path khilari Linux - Newbie 1 05-31-2006 12:53 PM
Traceroute, Ping, Domain Name Server (DNS) Lookup, WHOIS, and DNS Records Lookup netoknet General 1 05-09-2005 04:43 AM
Show Library Path for PHP on Linux? daprezjer Linux - Software 1 03-20-2005 09:35 PM
php upgrade path pxp Linux - Security 3 12-20-2004 10:08 AM
PHP Path include ..:eMa:.. Programming 4 09-25-2003 02:59 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:21 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration