Link to home
Start Free TrialLog in
Avatar of matt51
matt51

asked on

httpd and php3

I am running Redhat 6.1.  I am trying to install IMP (imap webmail).  In order to do that I need PHP working.  I have installed php3-3.0.1.12-6 (an RPM). I then uncommented LoadModule php3_module  libexec/libphp3.so and AddModule mod_php3.c from the httpd.conf.  I also uncommented    AddType application/x-httpd-php3 .php3 AddType application/x-httpd-php3-source .phps from srm.conf.  

I went to restart httpd and I received this error: tarting httpd: Syntax error on line 171 of /etc/httpd/conf/httpd.conf:
Invalid command 'LoadModule', perhaps mis-spelled or defined by a module not included in the server configuration
[FAILED]

Any help?
Avatar of jlevie
jlevie

Somebody else might have had better luck, but I was never able to get IMP to work properly with the binary distributions of Apache, php, etc. I do have it working quite well using a setup built from sources, even doing IMP over an SSL encrypted connection.

If you want to try to go that route I've got a "recipe" of sorts that works on Solaris and Linux. Full up, you get an SSL Apache with Php supporting LDAP, IMAP, and the database of your choice.

Interested?
Assuming you have a working EXE for php in you cgi-bin, try adding this to your httpd.conf (or srm.conf) instead of the module verison.

AddType application/x-httpd-php3 .php3 .phtml

Action php3-script /cgi-bin/php3.cgi

AddHandler php3-script .php3

Avatar of matt51

ASKER

jlevie, I would be interested.  With everything I've read, using the rpm's doesn't work well.  I had planned on intsalling the latest version of apache along with php from source.  Any help you could give would be wonderful.
Avatar of matt51

ASKER

I don't have a working exe
ASKER CERTIFIED SOLUTION
Avatar of jlevie
jlevie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
1. U can download TAR.gz from URL pointed by php.net
2.untar it
3.go to that dirctory
4. ./configure with options path
5.if there is any errors surely it must be due to path problem
6.make
7. make install
8.change the option as directed by readme file
9. restrat the daemon
10 check the application
Avatar of matt51

ASKER

Sokka,

That is what I did in the first place.  And my question is why I was getting the error above after doing all that.
Avatar of matt51

ASKER

Adjusted points from 50 to 100
Avatar of matt51

ASKER

jlevie,

I removed all rpms and followed all your instructions to the letter.  However, apache isn't using php.  When I went and added the LoadModule and Addmodule to httpd.conf like the php readme said.  I still get that same error.  It's like it is looking for the libphp.so file and cant find it.  (there is no modules directory in apache for modules).  Is that something I have to install separately?
Did you build it as the SSL enabled server and see the note about where the modules are? The PHP build process does add the modules to the httpd.conf file, but on an SSL server they wind up inside the SSL conditional. If the lines:

LoadModule php3_module        libexec/libphp3.so
AddModule mod_php3.c

weren't in your httpd.conf file once you built and installed php, then the configure build & install of php didn't work (and neither will php). Also if you manually added the lines then they are in the conf file twice, and I don't know what Apache would have to say about that.

Minor intermission while Jim experiments... Okay I've just finished building a server according to what's in my recipe. I had the recipe in one window and literally cut & pasted the appropriate lines from the recipe into another teminal window. Other than the fact that I've left out the instructions to uncomment the "AddType" lines for php, everything else worked as expected and the server I built does do php. I know this recipe has been used by a number of other folks to build a php enabled server, so I'm at a bit of a loss as to what's happened.

Can I see the contents of config.status in your apache source dir and the configure line near the top of the config.status file in the php source dir?
Avatar of matt51

ASKER

Adjusted points from 100 to 150
Avatar of matt51

ASKER

Sorry for the delay.  The HD in my machine and I had to reinstall Linux.  I get to the point where I'm configuring Apache and I get this:
 
Configuring for Apache, Version 1.3.12
 + using installation path layout: Apache (config.layout)
Creating Makefile
Creating Configuration.apaci in src
 + enabling mod_so for DSO support
Error: Cannot find SSL binaries in /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin:/root/bin
Creating Makefile in src
 + configured for Linux platform
 + setting C compiler to gcc
 + setting C pre-processor to gcc -E
 + checking for system header files
 + adding selected modules
    o rewrite_module uses ConfigStart/End
 + using -lndbm for DBM support
      enabling DBM support for mod_rewrite
    o dbm_auth_module uses ConfigStart/End
    o ssl_module uses ConfigStart/End
      + SSL interface: mod_ssl/2.6.2
      + SSL interface build type: DSO
      + SSL interface compatibility: enabled
      + SSL interface experimental code: disabled
      + SSL interface conservative code: disabled
      + SSL interface vendor extensions: disabled
      + SSL interface plugin: Built-in SDBM
      + SSL library path: [SYSTEM]
Avatar of matt51

ASKER

The HD crashed.
Avatar of matt51

ASKER

Ok, ignore my last post.  I tried it one more time and everything worked OK.  I moved the LoadModules and AddModules out of the ssl conditional.  Started up the server and no luck, then I went back and uncommented the addtype.  Then I get this error when restarting the server:

Syntax error on line 774 of /opt/Apache/conf/httpd.conf:
Unrecognized LogFormat directive %x

Here is apache's config.status:

#!/bin/sh
##
##  config.status -- APACI auto-generated configuration restore script
##
##  Use this shell script to re-run the APACI configure script for
##  restoring your configuration. Additional parameters can be supplied.
##

EAPI_MM="../mm-1.0.12" \
SSL_BASE="../openssl-0.9.5" \
../configure \
"--with-layout=Apache" \
"--prefix=/opt/Apache" \
"--enable-module=most" \
"--enable-shared=max" \
"--enable-module=ssl" \
"--enable-shared=ssl" \
"--enable-rule=SSL_SDBM" \
"$@"

Here is the top of PHP's config.status:

#! /bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host ns1:
#
# ./configure  --with-apxs=/opt/Apache/bin/apxs --without-gd --with-config-file-path=/opt/Apach
e/conf
#
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.

I won't be able to look closely at the last one I built on RedHat until this evening, but in the meantime... Are you starting Apache via "/opt/Apache/bin/apachectl start" from a shell or by invoking the RedHat init script? Also, if you want to you can email /opt/Apache/conf/http.conf to jlevie@bellsouth.net and I'll look it over.

Oh yeah, the configure lines all look to be correct, so the server should be good.
Avatar of matt51

ASKER

Adjusted points from 150 to 200
Avatar of matt51

ASKER

Thank you very much for your help.  It finally works.