Go Back  PPRuNe Forums > Misc. Forums > Computer/Internet Issues & Troubleshooting
Reload this Page >

How to find path to Linux programs?

Wikiposts
Search
Computer/Internet Issues & Troubleshooting Anyone with questions about the terribly complex world of computers or the internet should try here. NOT FOR REPORTING ISSUES WITH PPRuNe FORUMS! Please use the subforum "PPRuNe Problems or Queries."

How to find path to Linux programs?

Thread Tools
 
Search this Thread
 
Old 30th Sep 2004, 08:40
  #1 (permalink)  

'nough said
Thread Starter
 
Join Date: Sep 2002
Location: Raynes Park
Age: 58
Posts: 1,025
Likes: 0
Received 0 Likes on 0 Posts
Question How to find path to Linux programs?

Dear Linux-gurus,

Can someone remind the command to display the path to programs - I need to confirm where PHP is running from on my server - It's supposed to be /usr/local/lib/php.

I seem to recall it's something like "where php" or "what php" or similar and, for once, Google is no help (or I'm not searching the correct keyword).

Cheers
Charles
amanoffewwords is offline  
Old 30th Sep 2004, 08:43
  #2 (permalink)  
Evo
 
Join Date: Sep 2002
Location: Chichester, UK
Posts: 1,650
Likes: 0
Received 0 Likes on 0 Posts
I think whereis is what you're looking for, e.g.

>evo@camel: whereis konqueror
konqueror: /opt/kde3/bin/konqueror

alternatively, you can do rpm -qpil filename.rpm to find out where it puts things - not quite what you're after, but also useful for tracking things down.
Evo is offline  
Old 30th Sep 2004, 08:46
  #3 (permalink)  
Supercalifragilistic
expialidocious
 
Join Date: Sep 2001
Location: Essex, UK
Posts: 588
Likes: 0
Received 0 Likes on 0 Posts
Finding Files in Linux at:

http://www.comptechdoc.org/os/linux/...ugfinding.html

has a good summary, I stumbled across it looking for examples of the locate command.
Memetic is offline  
Old 30th Sep 2004, 09:15
  #4 (permalink)  

'nough said
Thread Starter
 
Join Date: Sep 2002
Location: Raynes Park
Age: 58
Posts: 1,025
Likes: 0
Received 0 Likes on 0 Posts
Thanks Evo - that's exactly what I was looking for.

whereis php gives me:

php: /usr/bin/php /etc/php.ini /usr/lib/php /usr/lib/php.ini
/usr/local/bin/php /usr/local/lib/php /usr/local/lib/php.ini /usr/include/php


Do you know if it's normal to have /usr/bin/php and /usr/local/bin/php - that looks like duplicate installations to me?

Thanks Memetic for the link - it has been bookmarked
amanoffewwords is offline  
Old 1st Oct 2004, 00:03
  #5 (permalink)  
 
Join Date: Sep 2002
Location: London, UK
Posts: 778
Likes: 0
Received 0 Likes on 0 Posts
'whereis X' will tell you if the program X is in one of the typical locations for executables.

If you want to know WHICH version of the executable X will be run if you type the command without specifyin a path then you need to use 'which X'.

Sometimes you'll find /usr/bin/php is a symbolic link to /usr/local/bin/php. To find out, examine the output of:

ls -al /usr/bin/php

If it isn't you could try:

diff /usr/local/bin/php /usr/bin/php

to see if they're the same. If they're not then try:

/usr/bin/php -version

and

/usr/local/bin/php -version

to see which version is which.
drauk is offline  
Old 1st Oct 2004, 07:53
  #6 (permalink)  

'nough said
Thread Starter
 
Join Date: Sep 2002
Location: Raynes Park
Age: 58
Posts: 1,025
Likes: 0
Received 0 Likes on 0 Posts
Thanks Drauk - which did it and you're correct about the symbolic link to /usr/local/bin/php. Just got to figure why my cron job is still not working. Just wished there was command such as
whatisthematterwithyou cron.php
amanoffewwords is offline  
Old 1st Oct 2004, 11:15
  #7 (permalink)  
 
Join Date: Sep 2002
Location: London, UK
Posts: 778
Likes: 0
Received 0 Likes on 0 Posts
I don't know much about PHP I'm afraid and it's hard to know where to look without more details of your problem. However, 2 thoughts:

1) Have you tried this simple script in order to get a lot of information about PHP and how it is configured on your system? Create a file with (just) the following:

<?php phpinfo() ?>

You can then execute this from your web browser or from the command line.

2) Problems with CRON jobs are most often related to the user environment in which they are running - mostly environment variables that are setting the user's path, default langauge, timezone etc. Try printing out the values from the script in CRON to check they are what you expect them to be.
drauk is offline  

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Contact Us - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service

Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.