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/

I have tried multiple variations in this including:

LoadModule php4_module         /usr/libexec/apache/

which is where the .so was originally located. I then copied to /usr/local/apache/libexec directory. I can't get either to work. What's wrong?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

the correct  one is
LoadModule php4_module        libexec/
just make sure that the is located under /usr/local/apache/libexec  NOT /usr/libexec/apache

Try this LoadModule php4_module /usr/local/apache/libexec/

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

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

AddModule mod_so.c

in your httpd.conf

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

jmarkfoleyAuthor Commented:
WaielEid: is located under /usr/local/apache/libexec. I tried:
LoadModule php4_module /usr/local/apache/libexec/
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:
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.

> Is this an Apache build directive?

>  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
(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
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?
jmarkfoleyAuthor Commented:
OK, I rebuilt apache with --enable-module=so. To my httpd.conf I added:

LoadModule php4_module  /usr/local/apache/libexec/
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.
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
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.