LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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

Reply
 
Search this Thread
Old 06-21-2003, 01:01 PM   #1
bigswifty75
LQ Newbie
 
Registered: Jun 2003
Distribution: RH 8
Posts: 5

Rep: Reputation: 0
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.
 
Old 06-21-2003, 01:11 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
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?
 
Old 06-21-2003, 01:19 PM   #3
bigswifty75
LQ Newbie
 
Registered: Jun 2003
Distribution: RH 8
Posts: 5

Original Poster
Rep: Reputation: 0
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
 
Old 06-21-2003, 01:21 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Take a look at rpmfind:
http://rpmfind.net/linux/rpm2html/se...redhat-8&arch=

It is available from the disks though.
 
Old 06-21-2003, 02:15 PM   #5
Rick422
Member
 
Registered: Apr 2003
Location: Arizona
Distribution: Red Hat Linux 9
Posts: 158

Rep: Reputation: 30
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.
 
Old 06-21-2003, 02:32 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
To make servers start on boot use:
chkconfig mysqld on
chkconfig httpd on
 
Old 07-01-2003, 02:03 PM   #7
jgaraas
LQ Newbie
 
Registered: May 2003
Posts: 27

Rep: Reputation: 15
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"
 
Old 07-01-2003, 03:05 PM   #8
jgaraas
LQ Newbie
 
Registered: May 2003
Posts: 27

Rep: Reputation: 15
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.
 
Old 07-03-2003, 03:47 AM   #9
FNC
Member
 
Registered: Feb 2001
Location: South Africa
Distribution: Fedora, Mandriva, PCLOS, SUSE - anything a can get my hands on
Posts: 140

Rep: Reputation: 15
Thanks a lot for the info - It helped me a lot!!!!!!!!!!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2.0.52, t1lib-5.0.2, php-apache2-5.0.2 wizard7423 Slackware 2 04-04-2011 08:09 PM
Mandrake 10.1 Apache2 with PHp and pear problem Jediman Linux - Software 10 04-19-2005 03:35 PM
Apache2, PHP and Gallery problem itamarl Linux - Software 6 04-05-2005 01:36 AM
php5 apache2 mysql4 don't work, php does not seem to read php.ini atom Linux - Software 5 03-24-2005 11:05 AM
Problem with PHP 4.3.4 and Apache2 Jeniva Linux - Newbie 7 11-16-2003 03:57 AM


All times are GMT -5. The time now is 09:20 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration