LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-15-2007, 04:01 PM   #1
jCash
Member
 
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, 05:24 PM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Quote:
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:
Code:
masterc@rackster ~ $ which ls
/usr/bin/ls
OR
Code:
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:
Code:
masterc@rackster ~ $ which php
/usr/bin/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:
Code:
/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).

HTH

Cool
 
  


Reply



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 11:53 AM
Traceroute, Ping, Domain Name Server (DNS) Lookup, WHOIS, and DNS Records Lookup netoknet General 1 05-09-2005 03:43 AM
Show Library Path for PHP on Linux? daprezjer Linux - Software 1 03-20-2005 08:35 PM
php upgrade path pxp Linux - Security 3 12-20-2004 09:08 AM
PHP Path include ..:eMa:.. Programming 4 09-25-2003 01:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:37 AM.

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