Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5659
  • Last Modified:

Invalid Command 'LoadModule'

I am trying to configure Apache 1.3.33 on Linux to enable php. I believe I have followed the instructions correctly. When I restart httpd I get:

Syntax error on line 211 of /usr/local/apache/conf/httpd.conf:
Invalid command 'LoadModule', perhaps mis-spelled or defined by a module not included in the server configuration

Line 211 is:

LoadModule php4_module         libexec/libphp4.so

I have tried multiple variations in this including:

LoadModule php4_module         /usr/libexec/apache/libphp4.so

which is where the .so was originally located. I then copied libphp4.so to /usr/local/apache/libexec directory. I can't get either to work. What's wrong?
0
jmarkfoley
Asked:
jmarkfoley
  • 4
  • 3
  • 3
2 Solutions
 
WaielEidCommented:
the correct  one is
LoadModule php4_module        libexec/libphp4.so
just make sure that the libphp4.so is located under /usr/local/apache/libexec  NOT /usr/libexec/apache


Try this LoadModule php4_module /usr/local/apache/libexec/libphp4.so

it might work :)
0
 
WaielEidCommented:
Also this might help you if you might configured Php wrong

http://www.php.net/manual/en/install.unix.php#install.unix.apache

0
 
ahoffmannCommented:
you missed --enable-module=so option when you started configure
or you have no

AddModule mod_so.c

in your httpd.conf
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jmarkfoleyAuthor Commented:
WaielEid: libphp4.so is located under /usr/local/apache/libexec. I tried:
LoadModule php4_module /usr/local/apache/libexec/libphp4.so
but that didn't work either, same error. The link you gave is where I was following installation instruction. Like I said, I think I've done the right steps.

ahoffmann: I do have the AddModule mod_so.c in the conf file in fact I have:
ClearModuleList
AddModule mod_php4.c
immediately following the LoadModule.

What do you mean --enable-module=so? Is this an Apache build directive? If so, when I do httpd -L it does list LoadModule as an available configuration directive.

0
 
ahoffmannCommented:
> Is this an Apache build directive?
yes

>  If so, when I do httpd -L it does list LoadModule as an available configuration directive.
then you should have mod_so loaded, you can check with  httpd -l  or with
  http://your.tld/server-info
(if enabled)

I guess you have a httpd.conf in wrong format, somehow
Check with od or vi if there're some uncommon chracters around this line
0
 
jmarkfoleyAuthor Commented:
Ah ha! when I do httpd -l mod_so.c is *not* listed. Do I have to rebuild Apache or can I load this via a httpd.conf directive? Why would it list LoadModule as an available configuration directive (httpd -L) if mod_so was not configured?
0
 
WaielEidCommented:
0
 
jmarkfoleyAuthor Commented:
OK, I rebuilt apache with --enable-module=so. To my httpd.conf I added:

LoadModule php4_module  /usr/local/apache/libexec/libphp4.so
ClearModuleList
AddModule mod_php4.c
:
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

However, it would not run and said:

Invalid command 'Order', perhaps mis-spelled or defined by a module not included in the server configuration

That seemed wrong. The only "Order" command I have is Order allow,deny in the <directory> sections, so I figured maybe the ClearModuleList was clearing things I didn't want cleared ... dunno. So I removed the ClearModuleList and httpd ran, but gave me "mod_php4.c already loaded". So I removed the AddModule directive.

Things *seem* to be running. I was able to use my browser to open the test <? phpinfo(); ?> in a php file.

Do I need these ClearModuleList and AddModule directives? Why would the instructions tell me to use them if they don't work. I must be doing something else wrong.
0
 
ahoffmannCommented:
sounds like you messed up your httpd.conf
how about starting with the original one which comes with apache, if that works add the PHP stuff and try again
0
 
jmarkfoleyAuthor Commented:
Except for adding ssl, I basically am using the original conf. Perhaps it has to do with where in the conf I've placed the ClearModuleList and AddModule directives. In any case, it seems to be working, so I'll just leave well enough alone.  Thanks
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 4
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now