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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
the default install from the rpms include apache, php and mysql but for some reason they do not operate correctly, sadly rh docs do not include the setup info for httpd.conf and apaches site and php's both have differing, conflicting and outdated config info.
where can I find instructions to configure php mysql and apache from the default rpm setup on RH8?
from past exp I found that you need to add the 2-3 lines in the httpd.conf file, modify the php.ini file for the new changes in globals and short tags and also find the php-mysql source code, but I cant seem to find the info I used last time, nor can I find 2 sets of instructions that are the same
and most of all why is this not configured in the first place, kind of like buying a house with 2 baths and a kitchen, but with no plumbing.
From what you said I assume you said I assume that you have apache, php and mysql installed. So you probably just need to know how to start them up. I have Red Hat 9 and I found that choosing to have it installed does not mean that the installation program will set it up to start automatically for you. To start with see if the daemons for each of the three programs are currently running or not. Log in as root or use the su command, then enter these two commands and see what the respose is:
If it says they are stopped then start them by typing this:
The two commands above will only temporarily start the two daemons. When you reboot they will still not automaically start for you. I have not yet bothered to try to figure out how to make them start automaically. For now I am comfortable just starting the daemons whenever I want to practice using php, apache and mysql. That only starts the daemons. You might also want to go into the /etc/httpd/conf directory and open up the httpd.conf file with a text editor. You can take a look at that file but the more I think about it you probably will not need to change anything in that file. You can probably close the file without doing anything to it.
Next go into the /var/www/html directory and make sure there is a file called index.html. Hopefully, it will already be there, if not create any simple possible HTML file and give it that name and save it in that directory. Next see if you can view that web page by opening your browser and typing in either your loopback address or the IP address of your computer or the domain name of your computer if you have one. To use the loopback address type in what is below into where the address is showin near the top of the screen on your browser:
Did the web page appear? If so lets go on to trying out myslq. At the command line type in mysql and see if anything happens. You can also try typing in the command below.
It may or may not currently be configured to allow you to use those without a password while you are logged in as an ordinary user. If that is a problem try it while logged in a root. To try out php create a very simple php file and save it with some name and the php extensin in the /var/www/html directory. If you have a file named something like helloWorld.php in that directory then try opening it from your browser by typing in this:
Did that work? I hope I did not forget to tell you anything. I wrote that up very quickly and not very carefully just now. I am learning to use php and mysql right now. On problem I ran into wtih is that for security reasons superglobals are now tuned off by default in Apache. The php book I am reading was written two years ago and uses a method to transfer data from one form to another that will not work with superglobals turned off. I went to the forum for the php book and found where the author had answered a question on that subject. He gave a simple explanation of how it should now be done. He said to leave it tuned, but in the form reciving data sent by POST or GET we should do one detail slightly different. His suggestion worked on my computer and my PHP scripts now work.
If what I said above does not work let me know. I might have forgotton some detail.
In answer to my own question, I found a posting on a news group with a similar problem. The solution is listed below:
On your Red Hat 8.0 machine, just edit the /etc/php.ini file
and change the following 2 lines from:
short_open_tag = Off
register_globals = Off
short_open_tag = On
register_globals = On
The short_open_tag = On allows php code to be indicated by "<?" rather
than "<?php". This change was made so that multiple languages (XML) may
be referenced in the same manner "<?[php,xml]". The change in this
default value caused all of the "My PHP code is displayed as text
instead of executing when running Apache 2.0" postings.
The register_globals = Off is a security driven change that corrects the
ability for malicious string to be executed by PHP programs on a
webserver. Basically the change requires the global variables be
explicit rather than implicit. when set to off, this typically breaks a
"bunch 'o stuff" like "can't post form data to a database", "can't
connect to a database", "PHP functions don't pass parameters" - well it
breaks almost all older PHP code. Setting this value to "On" restores
the default behavior of PHP/Apache1.x.