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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
06-21-2003, 02:01 PM
|
#1
|
LQ Newbie
Registered: Jun 2003
Distribution: RH 8
Posts: 5
Rep:
|
whats the problem with rh8 and apache2/php?
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.
|
|
|
06-21-2003, 02:11 PM
|
#2
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
It should just work out of the box. amke sure you have the following 3 rpms installed:
apache
php
php-mysql
What happens if you try just a plain phpinfo page?
|
|
|
06-21-2003, 02:19 PM
|
#3
|
LQ Newbie
Registered: Jun 2003
Distribution: RH 8
Posts: 5
Original Poster
Rep:
|
thats one of the things that bothers me,
php-mysql does not install from the package selection menu, you have to dig to find it, and it is not realy mentioned anywhere.
I'll have to try to find it again on the disks
thanks for the input
Cheers 
|
|
|
06-21-2003, 03:15 PM
|
#5
|
Member
Registered: Apr 2003
Location: Arizona
Distribution: Red Hat Linux 9
Posts: 158
Rep:
|
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:
/etc/init.d/httpd status
/etc/init.d/mysqld status
If it says they are stopped then start them by typing this:
/etc/init.d/httpd start
/etc/init.d/mysqld start
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:
127.0.0.1
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.
mysqladmin --help
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:
127.0.0.1/helloWorld.php
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.
|
|
|
06-21-2003, 03:32 PM
|
#6
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
To make servers start on boot use:
chkconfig mysqld on
chkconfig httpd on
|
|
|
07-01-2003, 03:03 PM
|
#7
|
LQ Newbie
Registered: May 2003
Posts: 27
Rep:
|
I would like to continue this posting in order to figure out my problem. I like the original poster am having problems with a RedHat 8 install with PHP and MySql out of the box.(rpm)
I did as you advised in a previous posting and checked for installed packages. I have the following installed:
php-4.2.2-8.0.5
php-mysql-4.2.2-8.0.5
httpd-2.0.40-8
I've also tried to run phpinfo and all I get is a blank screen.
I'd appreciate any assistance in this. By the way id did a quick search in the httpd.conf file and didn't find a single reference of "php"
|
|
|
07-01-2003, 04:05 PM
|
#8
|
LQ Newbie
Registered: May 2003
Posts: 27
Rep:
|
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
to
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.
I hope this helps others out.
|
|
|
07-03-2003, 04:47 AM
|
#9
|
Member
Registered: Feb 2001
Location: South Africa
Distribution: Fedora, Mandriva, PCLOS, SUSE - anything a can get my hands on
Posts: 140
Rep:
|
Thanks a lot for the info - It helped me a lot!!!!!!!!!!!
|
|
|
All times are GMT -5. The time now is 10:49 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|