LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Default Apache & PHP install on RH 8.0 (https://www.linuxquestions.org/questions/linux-general-1/default-apache-and-php-install-on-rh-8-0-a-35017/)

merana 11-09-2002 06:43 PM

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!
:study:

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

trickykid 11-09-2002 10:19 PM

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...

merana 11-10-2002 07:42 AM

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?

:study:

merana 11-10-2002 08:08 AM

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...

:study: :confused:

j-ray 11-10-2002 02:08 PM

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

darky 11-10-2002 02:42 PM

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

merana 11-10-2002 03:25 PM

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 :study:

davee 11-11-2002 03:36 AM

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'?

merana 11-11-2002 05:43 AM

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. :study: Gallery

cirrusgr 11-11-2002 07:57 PM

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.

dwolchon 12-17-2002 03:34 PM

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

that fixed it

teded34 03-19-2003 12:01 PM

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.

merana 03-19-2003 03:31 PM

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... :study:

teded34 03-19-2003 03:38 PM

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

teded34 03-19-2003 03:57 PM

#
# 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


All times are GMT -5. The time now is 07:57 AM.