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