LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 03-24-2010, 05:20 AM   #1
sudipt
LQ Newbie
 
Registered: Feb 2009
Posts: 12

Rep: Reputation: 0
Find Installation Path - which <application>, can I use readlink -f in this case


Hello everyone.. I am sorry if i m repeating a thread, but honestly i tried searching the forum before coming up with this question. however i need your help..

Basically i need to link apache - mysql - php using the following :

#> ./configure --prefix=/usr/local/php \
--with-mysql=/usr/local/bin/mysql \
--with-apxs2=/usr/local/apache2/bin/apxs

But guess i need to know the installed locations for the same (correct me if i am wrong for i am a newbie)I tried looking for the same using the following command:
[root@dhcppc2 /]# which php
/usr/bin/php
[root@dhcppc2 /]# which mysql
/usr/bin/mysql
[root@dhcppc2 /]# which apache
/usr/bin/which: no apache in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

I am able to view my test page.Which means apache is working. On issuing the command ./configure command it comes up with error

[root@dhcppc2 php-5.3.2]# ./configure --prefix=/usr/bin/php \ --with-mysql=/usr/bin/mysql \ --with-apachectl=/usr/sbin/apachectl
configure: warning: --with-mysql=/usr/bin/mysql: invalid host type
configure: warning: --with-apachectl=/usr/sbin/apachectl: invalid host type
configure: error: can only configure for one host and one target at a time

I have tried one at a time but still the same. Please help me I am unable to run database queries using PHP, as simple as displaying the table contents.
 
Old 03-24-2010, 05:26 AM   #2
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 616

Rep: Reputation: 64
Quote:
Originally Posted by sudipt View Post
Hello everyone.. I am sorry if i m repeating a thread, but honestly i tried searching the forum before coming up with this question. however i need your help..

Basically i need to link apache - mysql - php using the following :

#> ./configure --prefix=/usr/local/php \
--with-mysql=/usr/local/bin/mysql \
--with-apxs2=/usr/local/apache2/bin/apxs

But guess i need to know the installed locations for the same (correct me if i am wrong for i am a newbie)I tried looking for the same using the following command:
[root@dhcppc2 /]# which php
/usr/bin/php
[root@dhcppc2 /]# which mysql
/usr/bin/mysql
[root@dhcppc2 /]# which apache
/usr/bin/which: no apache in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

I am able to view my test page.Which means apache is working. On issuing the command ./configure command it comes up with error

[root@dhcppc2 php-5.3.2]# ./configure --prefix=/usr/bin/php \ --with-mysql=/usr/bin/mysql \ --with-apachectl=/usr/sbin/apachectl
configure: warning: --with-mysql=/usr/bin/mysql: invalid host type
configure: warning: --with-apachectl=/usr/sbin/apachectl: invalid host type
configure: error: can only configure for one host and one target at a time

I have tried one at a time but still the same. Please help me I am unable to run database queries using PHP, as simple as displaying the table contents.
which command shows the location of a executable command, here you should use:
Quote:
#whereis php
 
Old 03-24-2010, 05:37 AM   #3
sudipt
LQ Newbie
 
Registered: Feb 2009
Posts: 12

Original Poster
Rep: Reputation: 0
No joy :-(

thanks Sayan for that quick reply, but no joy in terms of configuring the same.

./configure --prefix=/usr/bin/php \ --with-mysql=/usr/bin/mysql \ --with-apachectl=/usr/sbin/apachectl
configure: warning: --with-mysql=/usr/bin/mysql: invalid host type


/usr/bin/php was the output for "whereis php"

Last edited by sudipt; 03-24-2010 at 05:38 AM. Reason: typo
 
Old 03-24-2010, 05:39 AM   #4
sudipt
LQ Newbie
 
Registered: Feb 2009
Posts: 12

Original Poster
Rep: Reputation: 0
which path to choose

[root@dhcppc2 /]# whereis php
php: /usr/bin/php /etc/php.d /etc/php.ini /usr/lib/php /usr/share/man/man1/php.1.gz
 
Old 03-24-2010, 06:07 AM   #5
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,606

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Quote:
Originally Posted by sudipt View Post
[root@dhcppc2 /]# whereis php
php: /usr/bin/php /etc/php.d /etc/php.ini /usr/lib/php /usr/share/man/man1/php.1.gz
Hi,
I have not compiled apache yet, but you can try the /usr/lib/php path. As for the other issue of the installation location you can try:
Code:
find / -name apache* -type f
This should give you some results to choose from.
You should also read the README file. It will probably have more information wether using the libs or binaries in your configure command.

One more important thing is, that when a compilation fails you should start with a fresh source. I.e. do not just start compiling again but delete the folder and untar the source file again.
Chances are that you might also have to create a dedicated build directory. The README file will have information about this.
 
Old 03-24-2010, 07:34 AM   #6
sudipt
LQ Newbie
 
Registered: Feb 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by crts View Post
Hi,
I have not compiled apache yet, but you can try the /usr/lib/php path. As for the other issue of the installation location you can try:
Code:
find / -name apache* -type f
This should give you some results to choose from.
You should also read the README file. It will probably have more information wether using the libs or binaries in your configure command.

One more important thing is, that when a compilation fails you should start with a fresh source. I.e. do not just start compiling again but delete the folder and untar the source file again.
Chances are that you might also have to create a dedicated build directory. The README file will have information about this.
If nothing works I shall have to install everything from scratch, or may be use xampp but I am trying to fiddle with your help. May be with the following information you might have a clear picture :

a) php code displays successful results on the browser.
b) mysql runs fine from terminal.
c) database connectivity through php doesnt work.

I'm sorry if i sound stupid :-) .. but does that mean php and apache are configured correctly and mysql is not ?

Last edited by sudipt; 03-24-2010 at 07:36 AM.
 
Old 03-24-2010, 06:34 PM   #7
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,606

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Quote:
Originally Posted by sudipt View Post
If nothing works I shall have to install everything from scratch, or may be use xampp but I am trying to fiddle with your help. May be with the following information you might have a clear picture :

a) php code displays successful results on the browser.
b) mysql runs fine from terminal.
c) database connectivity through php doesnt work.

I'm sorry if i sound stupid :-) .. but does that mean php and apache are configured correctly and mysql is not ?
Hi,

I just downloaded php and it appears that you do NOT have to start from scratch or create a seperate build-directory.
Have you tried to issue the configure command without expicitly naming the path, i.e.
Code:
#> ./configure --prefix=/usr/local/php --with-mysql --with-apxs2
BTW, in your first post you write that you issued the following command
Code:
#> ./configure --prefix=/usr/local/php \
--with-mysql=/usr/local/bin/mysql \
--with-apxs2=/usr/local/apache2/bin/apxs
And then
Code:
./configure --prefix=/usr/bin/php \ --with-mysql=/usr/bin/mysql \ --with-apachectl=/usr/sbin/apachectl
So are you searching for the path of apxs or apchectl now?
 
Old 03-25-2010, 01:56 AM   #8
sudipt
LQ Newbie
 
Registered: Feb 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by crts View Post
BTW, in your first post you write that you issued the following command
Code:
#> ./configure --prefix=/usr/local/php \
--with-mysql=/usr/local/bin/mysql \
--with-apxs2=/usr/local/apache2/bin/apxs
And then
Code:
./configure --prefix=/usr/bin/php \ --with-mysql=/usr/bin/mysql \ --with-apachectl=/usr/sbin/apachectl
So are you searching for the path of apxs or apchectl now?
Yes, I am kind of not sure which path to choose. And issuing your command gives me the following which certainly means i am wrong somewhere in terms of the paths. Please guide me :

[root@dhcppc2 php-5.3.2]# ./configure --prefix=/usr/local/php --with-mysql --with-apxs2
loading cache ./config.cache
checking for Cygwin environment... no
checking for mingw32 environment... no
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH
[root@dhcppc2 php-5.3.2]#
 
Old 03-25-2010, 03:42 AM   #9
sudipt
LQ Newbie
 
Registered: Feb 2009
Posts: 12

Original Poster
Rep: Reputation: 0
[root@dhcppc2 php-5.3.2]# whereis mysql
mysql: /usr/bin/mysql /usr/lib/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

I tried # ./configure --prefix=/usr/bin/php -with-/usr/lib/mysql with all the mentioned paths.. But the ouput comes out to be following:

configure: error: /usr/lib/mysql: invalid package name

[root@dhcppc2 php-5.3.2]# ./configure --prefix=/usr/bin/php -with-mysql
loading cache ./config.cache
checking for Cygwin environment... no
checking for mingw32 environment... no
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH
[root@dhcppc2 php-5.3.2]# cat $PATH
cat: /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin: No such file or directory

 
Old 03-25-2010, 11:59 AM   #10
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,606

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Quote:
Originally Posted by sudipt View Post
[COLOR="Blue"][root@dhcppc2 php-5.3.2]# ./configure --prefix=/usr/bin/php -with-mysql
loading cache ./config.cache
checking for Cygwin environment... no
checking for mingw32 environment... no
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH
Ok,

this looks like you don't have a compiler installed. Have you successfully compiled any packages before? If yes, what is the output of
Code:
whereis gcc
whereis g++

Last edited by crts; 03-25-2010 at 12:00 PM.
 
Old 03-29-2010, 04:56 AM   #11
sudipt
LQ Newbie
 
Registered: Feb 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by crts View Post
Ok,

this looks like you don't have a compiler installed. Have you successfully compiled any packages before? If yes, what is the output of
Code:
whereis gcc
whereis g++
[root@dhcppc16 ~]# whereis gcc
gcc: /usr/libexec/gcc
[root@dhcppc16 ~]# whereis g++
g++:


Well I stick to the cause while using linux.This is for the first time i am compiling something. Otherwise, I have used it for squid / load balancing etc.

Last edited by sudipt; 03-29-2010 at 05:59 AM.
 
Old 03-29-2010, 06:03 AM   #12
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,606

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Quote:
Originally Posted by sudipt View Post
[root@dhcppc16 ~]# whereis gcc
gcc: /usr/libexec/gcc
[root@dhcppc16 ~]# whereis g++
g++:


Well I stick to the cause while using linux.This is for the first time i am compiling something. Otherwise, I have used it for squid / load balancing etc.
Hmm, can you try
Code:
type gcc
type g++
gcc should reside in /usr/bin. But appearently this is not the case. So you should install/reinstall gcc and then retry.
 
Old 03-30-2010, 12:35 AM   #13
sudipt
LQ Newbie
 
Registered: Feb 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by crts View Post
Hmm, can you try
Code:
type gcc
type g++
gcc should reside in /usr/bin. But appearently this is not the case. So you should install/reinstall gcc and then retry.
Crts, I am really thankful for your help. Adding to your suggestion, may you also tell me if theres any command where i can view configuration of PHP with MySQL & Apache. GCC certainly is missing but I would like to know any command that can show the successful configuration of PHP with mysql and apache.FYI, I am able to view the output of phpinfo();

Code:
[root@dhcppc16 ~]# rpm -q gcc
package gcc is not installed
Thanks in advance
 
Old 03-30-2010, 02:40 AM   #14
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 616

Rep: Reputation: 64
php.ini file is responsible for php's behavior in the system, you can look at there for any ideas.
 
Old 03-30-2010, 03:29 AM   #15
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Quote:
Originally Posted by sudipt View Post
I would like to know any command that can show the successful configuration of PHP with mysql and apache.FYI, I am able to view the output of phpinfo();
phpinfo() is an ok way to check. You can't see anything because it is not successfully installed or configured.

Quote:
Code:
[root@dhcppc16 ~]# rpm -q gcc
package gcc is not installed
Ok, so you need to install it.

Evo2.
 
  


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
[SOLVED] ignore case in writing path in terminal sumeet inani Ubuntu 4 11-12-2009 01:45 AM
Find a file path and directory path ak.lokesh Linux - Newbie 3 02-19-2009 01:37 PM
cannot find installation path (adobe flash install) bloodyscript Linux - Software 7 06-11-2007 08:49 PM
Problem with readLink()? davidcwk Programming 3 04-08-2007 07:39 AM
readlink function.???? calsoft_pg Programming 0 01-08-2006 02:45 PM


All times are GMT -5. The time now is 07:00 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