LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-09-2002, 06:43 PM   #1
merana
Member
 
Registered: May 2002
Location: Philly/So. Jersey
Distribution: ESXi CentOS Red-Hat Ubuntuu Solaris Debian
Posts: 85

Rep: Reputation: 15
Default Apache & PHP install on RH 8.0


Hi All,

I've got a brand spanking new RH 8.0 install and I am trying to troubleshoot why PHP pages won't come up on the web server...

As I said this server is right out of the install and the Red Hat Installer did all the config. The following are the config files:

httpd.conf

php.conf

php.ini

The way RH 8.0 installs it is the httpd.conf file is in the /etc/httpd dir and then inside that is a conf and and conf.d directory that has the actual httpd.conf and the php.conf is in the conf.d directory.

The php.ini is in /etc.

Can anyone spot something assinine that I may be missing?

TIA!


PS: The server the files are on is NOT the same server that's having issues... LOL

Last edited by merana; 11-09-2002 at 06:45 PM.
 
Old 11-09-2002, 10:19 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Under your:
Code:
#
# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.
#
AddType application/x-tar .tgz
You can probably add something like this to get it working:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps


Also under your:
Code:
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents.  The MultiViews Option can be used for the 
# same purpose, but it is much slower.
#
DirectoryIndex index.html index.html.var
You could add the index.php just in case you make some php indexes and that way when specifying a page you don't have to type the full thing out if it has a index.php...
 
Old 11-10-2002, 07:42 AM   #3
merana
Member
 
Registered: May 2002
Location: Philly/So. Jersey
Distribution: ESXi CentOS Red-Hat Ubuntuu Solaris Debian
Posts: 85

Original Poster
Rep: Reputation: 15
Thanks for the reply Tricky!

I tried what you suggested but still no joy. I made the changes to the config files and then stopped and restarted Apache but it still wouldn't render a php page. I am trying to test it by running the;

<? phpinfo() ?>

test page.

All I get is a blank page but if I view source, I can see the commands.

Anything else to try?

 
Old 11-10-2002, 08:08 AM   #4
merana
Member
 
Registered: May 2002
Location: Philly/So. Jersey
Distribution: ESXi CentOS Red-Hat Ubuntuu Solaris Debian
Posts: 85

Original Poster
Rep: Reputation: 15
As an addition to this thread I'll add the following observations:

The httpd.conf file being loaded by this build is HEAVILY broken up in comparison with past versions I have worked with. Instead of all of the directives for the Daemon being placed IN the httpd.conf they put a bunch of them in the http.d directory and are all INCLUDED in the config read. (That why there was a separate php.conf file in the original message).

I have verified that all of the libs are there and that they actually match what should be there for the version being run. The only thing I haven't done is to check how the RedHat installer compiled the Apache Server and what modules it included. I ASSUME that since php was AUTOMATICALLY included in the install that it also COMPILED it as part of the server... Heck the conf files reference it so it would make sense that it should have right?

So it still remains as to why the Apache process is not handling the interpreting of the .php pages or internal directives correctly...

 
Old 11-10-2002, 02:08 PM   #5
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
first u should take a look at the php-error log file and apache log and error-log as well. i don't know where they are located but u'll find the address in php.ini and httpd.conf.
did u set the DocumentRoot in httpd.conf? if not u should do that.
post contents of php error-log if u don't find out yourself
cheers, jens

maybe the phpinfo() function is disabled in php.ini. u might try another piece of code

Last edited by j-ray; 11-10-2002 at 02:11 PM.
 
Old 11-10-2002, 02:42 PM   #6
darky
LQ Newbie
 
Registered: Nov 2002
Posts: 1

Rep: Reputation: 0
i had this same problem when installing RH8
my problem was that Apache was already installed, so i needed to remove it first

do this...
rpm -qa | grep http

it should find 2 packages
remove them both
remove the one with the word "redhat" in it first (it'll be like redhat-1.0.13-http or something like that
then remove the other one (it'll be like httpd-2.0.48 or something)

the default apache install puts the files in /var/www
doing the above will remove all that crap
then download apache and install it (which puts it in /usr/locall/apache)
then download php and install it

you should be golden


RH installed Apache by default because you selected a certain option on the install
doing a complete bare install does not install apache
 
Old 11-10-2002, 03:25 PM   #7
merana
Member
 
Registered: May 2002
Location: Philly/So. Jersey
Distribution: ESXi CentOS Red-Hat Ubuntuu Solaris Debian
Posts: 85

Original Poster
Rep: Reputation: 15
Hey! Takk Jens!

That was sort of it... I did find a DocumentRoot line in the php.ini... I set that and a more simplistic <?php Print "This is stuff" ?> worked...

I am having other config issues now so I may drop back and punt and follow darky's example....

I was kinda hoping that this install would be nice and clean and all (just based on RPMs) but I guess it's not to be.

Takk for the Help again!

Michael
 
Old 11-11-2002, 03:36 AM   #8
davee
Member
 
Registered: Oct 2002
Location: Ayrshire, Scotland
Distribution: Suse(home) RHEL (Work)
Posts: 263

Rep: Reputation: 30
Other issues?

One of the things I've had problems with is passing data from a form with a put or a get method...

The simple <?php Print "Hello" ?> stuff works as there is no data from another page, but it doesn't seem to recognise any variable names, or PHP system variables. Have you the same problem?

Anyone any idea why? Is it another RH8 'feature'?
 
Old 11-11-2002, 05:43 AM   #9
merana
Member
 
Registered: May 2002
Location: Philly/So. Jersey
Distribution: ESXi CentOS Red-Hat Ubuntuu Solaris Debian
Posts: 85

Original Poster
Rep: Reputation: 15
By way of update...

I ripped out the Default RPM for PHP and APACHE that came with the redhat install and I now have it 'functional'.

The main issues are the same ones that I am running into with the other server... (Namely the installation of stuff like GD libs, lib-JPEG, libPNG, and the like).

I am a bit disappointed in the RH install that they did not get the config scripts right to get this to run. Then again I am still NOT sure which order to install the stuff in... Seems kinda kludgy.... In this instance I installed Apache first and then PHP.

Now if I can only sort out the Gallery issues!

Arrugh. Gallery
 
Old 11-11-2002, 07:57 PM   #10
cirrusgr
LQ Newbie
 
Registered: Nov 2002
Distribution: Debian Stable/Testing
Posts: 12

Rep: Reputation: 0
I had the same problem when installing redhat8. Spend some time doing configuration changes and php would still not work. The problem was in the /etc/php.ini file. Just copied my old one over it, restarted apache and everything worked like a charm.
 
Old 12-17-2002, 03:34 PM   #11
dwolchon
LQ Newbie
 
Registered: Dec 2002
Posts: 1

Rep: Reputation: 0
solution!!

turn the short open tag on in /etc/php.ini

that fixed it
 
Old 03-19-2003, 12:01 PM   #12
teded34
LQ Newbie
 
Registered: Feb 2003
Posts: 11

Rep: Reputation: 0
hi merana,

what exactly did you change in the php.ini file to get it working as I am having the same problem. I changed it to use short tags but still scripting is not working, I can't even echo.
 
Old 03-19-2003, 03:31 PM   #13
merana
Member
 
Registered: May 2002
Location: Philly/So. Jersey
Distribution: ESXi CentOS Red-Hat Ubuntuu Solaris Debian
Posts: 85

Original Poster
Rep: Reputation: 15
Hi Teded...

You'll have to do a bit of describing of where you're at and how you got there so maybe I can chime in a more direct answer... There's lots of ways to get to an Installed state. It's all in how you do it that counts...
 
Old 03-19-2003, 03:38 PM   #14
teded34
LQ Newbie
 
Registered: Feb 2003
Posts: 11

Rep: Reputation: 0
I basically installed the cd's for redhat 8.0 (php,mysql,apache). When I run a PHP script I just get the code showing up on my web browser window, at first I couldn't even test if PHP was working because the short open tags was off, changed it to on and I verified PHP is working. But I cannot even get a echo command to work.
I can post my php.ini file if it will help
 
Old 03-19-2003, 03:57 PM   #15
teded34
LQ Newbie
 
Registered: Feb 2003
Posts: 11

Rep: Reputation: 0
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#

LoadModule php4_module modules/libphp4.so
#
# Cause the PHP interpreter handle files with a .php extension.
#
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
# LimitRequestBody 524288
</Files>

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

-----------------------------------------------------------------------------------
that is what is in my php.conf file
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware guide for AMP Apache MySQL & PHP xushi Slackware 35 05-11-2006 11:18 AM
ISS & ASP/.NET or Apache & PHP fuelinjection General 3 12-06-2005 07:41 AM
upgrading PHP on a RH9 server with default apache installation praefex Linux - General 4 06-29-2004 09:48 AM
From RedHat9 to FreeBSD (Apache 2 & Mysql & PHP 4) guardian653 *BSD 5 12-11-2003 05:31 PM
RH8 Modifying Default Apache / PHP config p4ck37p1mp Linux - General 4 02-10-2003 10:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration