LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-29-2009, 12:38 AM   #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, 01:12 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,900

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
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, 03: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, 12:42 PM   #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, 04:28 PM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,900

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
@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, 07:57 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,426

Rep: Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938
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 08:02 PM.
 
Old 06-01-2009, 01: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, 01:46 AM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

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


Reply


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

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

All times are GMT -5. The time now is 07:08 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration