Forum Moderators: phranque

Message Too Old, No Replies

LoadModules error.

         

fabiox

1:46 pm on May 3, 2005 (gmt 0)

10+ Year Member



I'm trying loading modules editing the file httpd.conf
The problem that appears is:

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

This line is:
# Example:
# LoadModule foo_module libexec/mod_foo.so
205 - LoadModule vhost_alias_module libexec/mod_vhost_alias.so

But the module is inside the path /usr/local/apache/libexec/ .

What i do?

I run httpd -l and:

Compiled-in modules:
http_core.c
mod_so.c
mod_bandwidth.c
mod_gzip.c

sitz

4:42 pm on May 3, 2005 (gmt 0)

10+ Year Member



That error is caused by the 'LoadModule' directive not being available to the webserver for some reason. The two likely causes are:

1) the 'httpd' binary you're using to run 'httpd -l' is not the one being called when you start apache, and the one being called when you start apache doesn't have mod_so.c compiled into it

2) (theory, untested) You've configured apache with ClearModuleList, but haven't used the AddModule directive to re-populate the module list

IIRC, the default httpd.conf has LoadModule directives for the modules, followed by some comments, followed by ClearModuleList, followed by AddModule directives corresponding to each of the LoadModule directives just above it. If you commented out all the AddModule directives, but failed to comment out the ClearModuleList directive as well, that could be the cause.

I'd suggest reading the documentation for:

ClearModuleList: [httpd.apache.org ]
LoadModule: [httpd.apache.org ]
AddModule: [httpd.apache.org ]

fabiox

7:00 pm on May 3, 2005 (gmt 0)

10+ Year Member



i find the apache that is run and httpd -l show:
Compiled-in modules:
http_core.c
mod_env.c
mod_log_config.c
mod_mime.c
mod_negotiation.c
mod_status.c
mod_include.c
mod_autoindex.c
mod_dir.c
mod_cgi.c
mod_asis.c
mod_imap.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_access.c
mod_auth.c
mod_setenvif.c
mod_php4.c

The mod_so.c not is compiled. As i can recompile it? and if possible too mod_rewrite ...
Thanks

fabiox

7:48 pm on May 3, 2005 (gmt 0)

10+ Year Member



Well i recompiled with --enable-module=so and it was:
Compiled-in modules:
http_core.c
mod_env.c
mod_log_config.c
mod_mime.c
mod_negotiation.c
mod_status.c
mod_include.c
mod_autoindex.c
mod_dir.c
mod_cgi.c
mod_asis.c
mod_imap.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_access.c
mod_auth.c
mod_so.c
mod_setenvif.c
suexec: disabled; invalid wrapper /usr/local/apache/bin/suexec

But now the error change:
API module structure `env_module' in file /usr/local/apache/libexec/mod_env.so is garbled - perhaps this is not an Apache module DSO?
I think that mods in list not can to be in LoadModule in httpd.conf.It proceeds?

Sorry for very questions, but i'm not specialist in Apache...
I need of the Apache and PHP works mod_rewrite.

sitz

1:04 pm on May 4, 2005 (gmt 0)

10+ Year Member



You shouldn't be LoadModule-ing any module you have compiled in to the binary. To compile Apache with DSOs instead of hard-compiling the modules into the binary itself, you can simply use "--enable-shared=max" and "--enable-module=most". Note that all of this is documented in INSTALL and README.configure files that shipped with your Apache tarball. If you compile this way, you generate an 'httpd' binary which only has mod_so.c and core in it; all other modules will be installed in the libexec/ directory when you run 'make install', and can then be accessed (or not, at your option) via the LoadModule directive.

fabiox

2:33 pm on May 5, 2005 (gmt 0)

10+ Year Member



it not affect files or dir's of the site? :-)

fabiox

4:53 pm on May 5, 2005 (gmt 0)

10+ Year Member



Hi I do:
./configure --enable-shared=max --enable-module=most --enable-module=so
make
make install

With PHP
./configure --with-mysql --with-apache=../apache_1.3.31

in apache
./configure --prefix=/www --activate-module=src/modules/php4/libphp4.a
cp php.ini-dist /usr/local/lib/php.ini
And add httpd.conf
#
# AddType allows you to tweak mime.types without actually editing it, or to
# make certain files to be certain types.
#
AddType application/x-tar .tgz
AddType application/x-httpd-php .php

Donīt work... What i do?
HELPPPPP

sitz

6:39 pm on May 5, 2005 (gmt 0)

10+ Year Member



One problem at a time; does Apache work *without* PHP when you use --enabled-shared=max and so on? If so, have you read the PHP installation instructions [php.net]? Carefully? =)

fabiox

6:57 pm on May 5, 2005 (gmt 0)

10+ Year Member



Hi i like that php works module apache put in httpd.conf as LoadModule/AddModule.
First i do the pass enable-shared=max but don't work
Please, if possible write pass/pass(apache and PHP) as i can solve it.
Thnks.
(i read php manual and continue the same problem)
See [webmasterworld.com...]
And try as is in manual too.

fabiox

7:46 pm on May 5, 2005 (gmt 0)

10+ Year Member



First config

APACHE

./configure --prefix=/usr/local/apache --enable-shared=max --enable-module=most --enable-module=so
make
make install

PHP(4.3.8)
./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs
make

ERROR-------> /zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo Zend/zend_opcode.lo
Zend/zend_operators.lo Zend/zend_ptr_stack.lo Zend/zend_stack.lo Zend/zend_variables.lo
Zend/zend.lo Zend/zend_API.lo Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo
Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo Zend/zend_ini.lo
Zend/zend_qsort.lo Zend/zend_multibyte.lo Zend/zend_execute.lo sapi/apache/sapi_apache.lo
sapi/apache/mod_php4.lo sapi/apache/php_apache.lo main/internal_functions.lo -lcrypt
-lcrypt -lresolv -lm -ldl -lnsl -lcrypt -lcrypt -o libphp4.la
ext/ctype/ctype.lo: file not recognized: File truncated
collect2: ld returned 1 exit status
make: *** [libphp4.la] Error 1

--------------------------------------------------------------------------------------------

Second Config (MANUAL)
./configure --prefix=/usr/local/apache --enable-module=so
make
make install

PHP(4.3.8)
./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs
make

-lcrypt -lcrypt -lresolv -lm -ldl -lnsl -lcrypt -lcrypt -o libphp4.la
ext/ctype/ctype.lo: file not recognized: File truncated
collect2: ld returned 1 exit status
make: *** [libphp4.la] Error 1

fabiox

8:10 pm on May 6, 2005 (gmt 0)

10+ Year Member



Well, i get lastest package php and configure as static module and works :)