LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-28-2009, 11:38 PM   #1
linuxown
LQ Newbie
 
Registered: May 2009
Posts: 3

Rep: Reputation: 0
php executable path


Hi all,

I inherited this web server with php compiled.
When I type php, it says:

php: not found

It has php but I cannot find the path. It's not in the standard location like /usr/bin.
How would I go about finding the php executable path?
 
Old 05-29-2009, 12:12 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
If it was compiled from source, chances are that it's located in /usr/local/bin.
If you still can't find it, run as root the following 2 commands
Code:
updatedb
locate php
Regards
 
Old 05-29-2009, 02:13 AM   #3
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381

Rep: Reputation: 58
Try whereis php

And then add this path to your path env variable
 
Old 05-29-2009, 11:42 AM   #4
linuxfia
Member
 
Registered: Apr 2008
Distribution: ubuntu 7.10, centos 4 & 5
Posts: 84

Rep: Reputation: 15
When I type locate php, it says:
Quote:
sun [root]% locate
locate: Command not found.
When I type php, it says:
Quote:
sun [root]% php
php: Command not found.
When I type whereis php, it says:
Quote:
sun [root]% whereis php
php:
When I type php:, it says
Quote:
sun [root]% php:
sun [root]%
It wasn't in /usr/local/bin...

It's setup so weird...
 
Old 05-29-2009, 03:28 PM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
@linuxfia

You can install the (s)locate package, or you can use the more slow (in a big file system) command:
Code:
find / -name php
The commands "whereis" and "which" do not return any results if the command you're looking in not in your PATH.
 
1 members found this post helpful.
Old 05-29-2009, 06:57 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,750

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
What distribution / version is the server running?

Do you know the php version? The CLI did not appear until version 4.3
Even though apache is running with PHP it may not have been built with the CLI option.

and welcome to LinuxQuestions

Last edited by michaelk; 05-29-2009 at 07:02 PM.
 
Old 06-01-2009, 12:38 AM   #7
linuxown
LQ Newbie
 
Registered: May 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you for all the responses,

I get the same output when I try to find php
Quote:
damian [root]# whereis php
php:
The PHP version is 5.x.

Is there a way to find the path by reading the php.info file?
 
Old 06-01-2009, 12:46 AM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Just use the 'find' cmd as per post 5. If its on your system it'll find it.
 
  


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
getting the path of the running executable lorebett Programming 17 04-15-2009 10:48 AM
Executable file path problem jinics Linux - General 5 02-22-2007 06:51 AM
Making an executable/path into a command kc0ltv SUSE / openSUSE 2 01-22-2006 01:28 AM
Path of the executable brainstormingin Programming 4 03-25-2004 09:24 PM
Executable, but not in path. Sledge Red Hat 0 12-03-2003 08:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:55 PM.

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