LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Find Installation Path - which <application>, can I use readlink -f in this case (https://www.linuxquestions.org/questions/linux-newbie-8/find-installation-path-which-application-can-i-use-readlink-f-in-this-case-797497/)

sudipt 03-24-2010 04:20 AM

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.

Sayan Acharjee 03-24-2010 04:26 AM

Quote:

Originally Posted by sudipt (Post 3910152)
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

sudipt 03-24-2010 04:37 AM

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"

sudipt 03-24-2010 04:39 AM

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

crts 03-24-2010 05:07 AM

Quote:

Originally Posted by sudipt (Post 3910166)
[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.

sudipt 03-24-2010 06:34 AM

Quote:

Originally Posted by crts (Post 3910183)
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 ?

crts 03-24-2010 05:34 PM

Quote:

Originally Posted by sudipt (Post 3910246)
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?

sudipt 03-25-2010 12:56 AM

Quote:

Originally Posted by crts (Post 3910958)
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]#

sudipt 03-25-2010 02:42 AM

[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


crts 03-25-2010 10:59 AM

Quote:

Originally Posted by sudipt (Post 3911427)
[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++


sudipt 03-29-2010 03:56 AM

Quote:

Originally Posted by crts (Post 3911866)
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.

crts 03-29-2010 05:03 AM

Quote:

Originally Posted by sudipt (Post 3916399)
[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.

sudipt 03-29-2010 11:35 PM

Quote:

Originally Posted by crts (Post 3916483)
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

Sayan Acharjee 03-30-2010 01:40 AM

php.ini file is responsible for php's behavior in the system, you can look at there for any ideas.

evo2 03-30-2010 02:29 AM

Quote:

Originally Posted by sudipt (Post 3917481)
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.


All times are GMT -5. The time now is 04:08 PM.