PDA

View Full Version : Apache PHP problem


n4t3d
1st February 2005, 03:01 AM
I'm having a little bit of trouble, here. I've installed Apache and PHP, as it comes in .rpm form from the Fedora Core 3 CDs. I activated httpd, checked a basic .html page (which came up fine), but when I tried to go to a PHP page...no dice. And the strange thing is, it didn't even show the text from the PHP data. A page that was written thus:

<?php
phpInfo();
?>

Came up completely blank, and the source of the page looked like this:

<html><head></head></html>

I tried the same page on my laptop, running Red Hat 9, and the page displayed fine. I've been looking around, and I can't find any other modifications I need to make before PHP'll work...can someone help me out here? I have the httpd.conf file on hand, if you need to see a section of it...

Void Main
1st February 2005, 03:20 AM
That means there was an error. Check your /var/log/httpd/error_log for messages. Also you can try running it at a shell prompt and see if it spits out any errors:

php tst.php

mattmattic
1st February 2005, 04:41 AM

Definitely doesn't sound like PHP is initializing.

Check: /etc/httpd/modules

Be sure you have: libphp4.so

If you don't have it, try reinstalling PHP using Yum.

adam
1st February 2005, 06:16 AM
Also definetely you should check your rights to execute this file =)

james_in_denver
1st February 2005, 05:00 PM
in your "/etc/httpd/conf/httpd.conf" file do you have the following lines?
LoadModule php4_module modules/libphp4.so

AddHandler php-script php
AddType text/html php

???????????//

That's what "tells" apache to load the "php" module and which files to pass the "php" module for processing. Otherwise all that nifty embedded "php" code won't get executed.

llbbl
25th November 2005, 02:28 PM
at the CLI just type
#php -v

It will print the version :D

I am thinking that it is either the httpd.conf file or you haven't installed the right packages. Oh sorry this thread is a lil old.. doh