LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Red Hat 8 : PHP/MySQL/Apache (https://www.linuxquestions.org/questions/linux-newbie-8/red-hat-8-php-mysql-apache-61509/)

jefx 05-24-2003 04:20 AM

Red Hat 8 : PHP/MySQL/Apache
 
Ok...I have the above installed and all working fine independenlyl.....how do I now link them all so I can start using them?

PHP
MySQL
Apache

Thanks in advance..

;)

Satriani 05-24-2003 02:52 PM

Jefx:

Im not sure i understand you. If you have apache, php and mysql installed, (did you install binaries, or with RPM, or similar?) what do you mean by "linking" them?

My best guess is: you want to run apache with php, and get information from your mysql database?

Then the setup is quite easy, depending on which version of apache you use.
As far as I know, php and apache2 do not (yet) work smoothly....

So what version do you use ?

jefx 05-24-2003 03:21 PM

Red Hat 8 PHP..etc
 
Hi

Thanks for your response..

I loaded all the packages when I loaded RedHat Distro.

My problem is I dont know how to make it all work together,...so I can learn PHP and MySQL etc....

I know all the packages are there..but I dont know where they are my hard drive.how do I find them?...

I have some books but they all refer to directing the set up towards specific folders ....not much help for me!

Thanks


Jefx

Satriani 05-24-2003 03:54 PM

ok, I don't now your level of experience, so maybe treat you as a complete newbie,but here's a start...

First check if apache is up and running. Two ways of doing that:
ps -aux |grep -i httpd
(This shows all processes with httpd in it, there should be some line in your processes)

second way is to open a browser and type: http://localhost
You should see a page, saying that apache is running, or something like that.

Is it ?

Rick422 05-24-2003 06:21 PM

You mentioned that mysql is installed. To use mysql you might start by checking to see if the mysqld daemon is running or not. An alternative method of checking that to what Satriani said is to type this:

//etc/init.d/mysqld status

It sould then tell you if it is running or not. If it is not running, first type the su command to temporarily get superuser priveleges if you are not currently logged in as root. Then type:

//etc/init.d/mysqld start

That will start the daemon and make mysql and mysqladmin available but using that method does not automatically make the daemon start for you each time. At that point you should be able to type either mysqladmin or mysql and have something happen. Do not know much more than that because I am not very far into the MySQL book yet. I did once set up the Apache web page server on a Linux box it out on in a computer class I took but do not have time at the moment to explain what what little I know Apache.

Rick422 05-24-2003 09:09 PM

I just realized that Satriani's post was about how to check to see if Apache is up and running. I had not bothered to read much of what he said before commenting in my post that I had an alternative to that. Well, of course, what I posted above is unrelated to how to check that. I was talking about starting the daemon for mysql and mysqladmin.

Satriani 05-25-2003 06:29 AM

Rick442:
Seems you know your way in mysql, that's not my strongest skill.. So I started with explaining apache first... (That one I know more of).. Maybe you could help jefx with learning / troubleshooting mySQL... I will try to get his apache / php up and running, and then let him connect php to mysql... That's all I can do...

It could be I am taking the long way, I'm still a newbie in this also... But, I got it working....

jefx 05-25-2003 01:17 PM

Red Hat 8 : PHP/MySQL/Apache
 
HI Guys

Thanks for the feedback....

Satriani :

typed in >> ps -aux |grep -i httpd..got this..

root 902 0.0 3.2 17504 8012 ? S 20:54 0:00 /usr/sbin/httpd
apache 967 0.0 3.2 17528 8048 ? S 20:54 0:00 /usr/sbin/httpd
apache 968 0.0 3.2 17528 8044 ? S 20:54 0:00 /usr/sbin/httpd
apache 969 0.0 3.2 17528 8044 ? S 20:54 0:00 /usr/sbin/httpd
apache 970 0.0 3.2 17528 8044 ? S 20:54 0:00 /usr/sbin/httpd
apache 971 0.0 3.2 17528 8044 ? S 20:54 0:00 /usr/sbin/httpd
apache 972 0.0 3.2 17528 8044 ? S 20:54 0:00 /usr/sbin/httpd
apache 973 0.0 3.2 17528 8044 ? S 20:54 0:00 /usr/sbin/httpd
apache 974 0.0 3.2 17528 8044 ? S 20:54 0:00 /usr/sbin/httpd
jef 1413 0.0 0.2 3204 620 pts/0 S 21:06 0:00 grep -i httpd




also tried >>> http://localhost.....says > localhost not found>
however when Im connected to the net I type in >>http://localhost ahain and it works !......


please note also when im offline I can also type in :http://localhost/manual/mod/core.html#documentroot and o get the Apache Module core page which is cool....

ok..typed in>> //etc/init.d/mysqld status everything fine type in>> mysql..no problems..mysql is working fine.


Rick422:

Typed in >> //etc/init.d/mysqld status got this :

mysqld (pid 872 869 868 856) is running...


So...things seem to be good so far...PHP next....

thanks again..

Satriani 05-25-2003 04:18 PM

OK then, it seems as if your apache is up as well as your mysql...

then let's check if your basic html page works:
I guess (since you installed from packages RPM) your document root for html is in /var/www/html
just place a simple index.html in this dir with some text, and see if it shows up when you type http://localhost/

If it does, your httpd is configured correct for plain html.

next , in this same dir create a file called "whatever.php"
in this file, put the following:

<?php
phpinfo();
?>

then in your browser again, type: http://localhost/whatever.php

See what happens... If you get the text you put in this file, then we can assume that PHP is not configured (yet).
But my best guess is, you will see a page containing a lot of information about your php installation. If so, check if you find anything about mysql in there.. It should be, since you installed the rpm... (At least, I assume you did install not only the mysql-server, but the client as well?)

If all of this works, we can start scripting a php page to connect to your database...

lemme know!

jefx 05-25-2003 06:24 PM

Php Etc
 
Hi Satriani


I got the page containing the information about my php (version 4.2.2) installation..xclnt ..thanks

tried the html file in var/www/html worked also..

The reference to Mysql in the PHP info was under the heading: "Configure Command" and states >>> with-mysql=shared,/usr <<<<<

now b4 we move on...please explain to me as to why the whole thing only works when I connect to the web and not when Im offline?

Also why it doesnt kick in when i log out and go into root?...is this a path config thing ?

in addition, could you please explain this Server and Client installation? does it relate to the above at all?


Regards

Jefx

:)

Satriani 05-28-2003 02:17 PM

Re: Php Etc
 
Jefx,
I have been offline for some dayz.. so a little late reply:


Quote:

Originally posted by jefx
please explain to me as to why the whole thing only works when I connect to the web and not when Im offline?

Mmmm, that's weird. You do this localhost thing on the linuxmachine itself, don't you? Or do you use another name for this machine? If you use another name for this machine, make sure it can be resolved without going online. (put that name in /etc/hosts for example)


Quote:

Originally posted by jefx
Also why it doesnt kick in when i log out and go into root?...is this a path config thing ?[/B]

It's not completely clear what kicks in? Doesn't apache start automatically? Or something else?


Quote:

Originally posted by jefx
in addition, could you please explain this Server and Client installation? does it relate to the above at all?
If you only install the mySQL server part, you act as: A server! Yeah really! :D

That means, you are only serving mysql to any other machine, who wants to use this service. ( A client) Since you want apache / php to be able to talk to mysql, you will need a client. This client takes care of retreiving information from the database, or storing it. So if you do not have a client installed on the same machine, you will have a database just sitting there, and waiting for a client to connect... Does that answer your question?

Also, let me know about the root-thingie and the online-thingie...


All times are GMT -5. The time now is 07:51 PM.