LinuxQuestions.org
Visit Jeremy's Blog.
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
 
LinkBack Search this Thread
Old 11-19-2001, 08:13 PM   #1
kngharv
Member
 
Registered: Nov 2001
Location: China, USA
Distribution: SUN JDS/SUSE 9.1
Posts: 33

Rep: Reputation: 15
apache and php module mod_php.so


I just installed apache and php on my Redhat 7.1. Both worked independently.

In fact, I can feed a test.php file on my URL and it will display properly:
http://localhost/test.php
However, My little apache does not parse php code embeded in HTML correctly.

I saw on the web that it I need to enable the PHP module on the apache by
feeding the arguement on the command line as I start apache:
httpd start -DHAVE_PHP

However, when I done that, I have encounter the following error message:

usr/sbin/> httpd restart -DHAVE_PHP
Syntax error on line 254 of /etc/httpd/conf/httpd.conf:
Cannot load /etc/httpd/modules/mod_php.so into server: /etc/httpd/modules/mod_php.so: cannot open shared object file: No such file or directory


and line 254 is the following:

253: <IfDefine HAVE_PHP>
254: LoadModule php_module modules/mod_php.so
255: </IfDefine>

and no, I don't have mod_php.so on my computer.

Is this the reason why my PHP is not working? am I suppose to find mod_php.so somewhere(which I have tried very hard and having no result)

Thanks in advance

Harvey H. King

Last edited by kngharv; 11-19-2001 at 08:14 PM.
 
Old 11-21-2001, 08:39 PM   #2
kngharv
Member
 
Registered: Nov 2001
Location: China, USA
Distribution: SUN JDS/SUSE 9.1
Posts: 33

Original Poster
Rep: Reputation: 15
apache, php, and mod_php

I figure it out!!!

it turned out that mod_php.so is corresponding to an older version of php module (version 2.0). Most of the recent distribution is equippted with mod_php4.so, which is more or less backward compatible with php 2.0

So, for those who are using Redhat and having problem to get PHP working on apache, all one need to do is to start apache with the arguement to start php4:

httpd start -DHAVE_PHP4

everything will work wonderfully...

ohh, one more thing. Redhat's default set up dictates that PHP does *NOT* parse the .html file. It will parse .phtml .shtml extention files. So, if any of you guys having problem get the php to work, then, rename it to .phtml and see... either that, or change the httpd.conf file.

good luck
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache + PHP Module chrisk5527 Linux - General 16 04-06-2004 06:09 AM
Installing PHP as an apache module? birv Linux - Software 2 04-05-2004 12:22 PM
Apache and mod_php :( bifur Linux - Software 1 02-29-2004 09:45 AM
Slack-8.1: Apache + mod_php pickledbeans Slackware 2 07-07-2002 11:40 AM
mod_php for apache in Redhat etfetius Linux - Software 1 05-24-2002 12:39 AM


All times are GMT -5. The time now is 03:05 AM.

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