Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Red Hat 7.3, Red Hat 9, Solaris8, Slackware 10, Slax on USB, AIX, FreeBSD, WinXP, AIX, Ubuntu
Posts: 418
Rep:
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....
Distribution: Red Hat 7.3, Red Hat 9, Solaris8, Slackware 10, Slax on USB, AIX, FreeBSD, WinXP, AIX, Ubuntu
Posts: 418
Rep:
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.
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.
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.
Distribution: Red Hat 7.3, Red Hat 9, Solaris8, Slackware 10, Slax on USB, AIX, FreeBSD, WinXP, AIX, Ubuntu
Posts: 418
Rep:
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....
Distribution: Red Hat 7.3, Red Hat 9, Solaris8, Slackware 10, Slax on USB, AIX, FreeBSD, WinXP, AIX, Ubuntu
Posts: 418
Rep:
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:
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...
Distribution: Red Hat 7.3, Red Hat 9, Solaris8, Slackware 10, Slax on USB, AIX, FreeBSD, WinXP, AIX, Ubuntu
Posts: 418
Rep:
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!
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...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.