Cannot add module via name 'mod_php4.c': not in list of loaded modules

rndinit0

Verified User
Joined
Jan 15, 2005
Messages
98
Syntax error on line 160 of /etc/httpd/conf/httpd.conf:
Cannot add module via name 'mod_php4.c': not in list of loaded modules
/usr/sbin/apachectl start: httpd could not be started

--------------------------------------------------------------
root@core# find / -name mod_php4.c
/usr/local/directadmin/customapache/php-4.3.11/sapi/apache/mod_php4.c

FreeBSD core.liquidmemory.net 5.4-RELEASE-p6 FreeBSD 5.4-RELEASE-p6 #1: Tue Aug 9 09:12:32 EDT 2005 root@server:/usr/obj/usr/src/sys/GENERIC i386

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

Started off with a clean install, followed by:

  1. Bash
  2. sudo
  3. screen
  4. spinner
    [/list=1]

    After which I installed DirectAdmin.

    Ive some other threads with reference to a dirty fix. But Im not too comfy with that idea.

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

    Also check this post out.

    If I use /usr/local/etc/rc.d/httpd start it starts up just fine.

    The problem is:

    If I restart the apache from the DirectAdmin CP it will fail.

    So how do we fix this ?

    UPDATE: Nope that doesnt work either:



    PHP:
    root@core# /usr/local/etc/rc.d/httpd start  Starting httpd:         [ OK ]  
    root@core# /usr/local/etc/rc.d/httpd stop   Stopping httpd:         [ FAILED ]  
    root@core# /usr/local/etc/rc.d/httpd start  Starting httpd:         [ OK ] 
    root@core# /usr/local/etc/rc.d/httpd start  Starting httpd:         [ OK ]  
    root@core# ps -ef |grep httpd

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

    Here is the relevent part from /etc/httpd/conf/httpd.conf

    PHP:
    <IfDefine HAVE_PHP4>
    LoadModule php4_module    modules/libphp4.so  
    </IfDefine>
    
    ---------------------
    
    ###<IfDefine HAVE_PHP4>  
    AddModule mod_php4.c       
    ###</IfDefine>

    -------------------------------------------------
    The dirty fix:

    PHP:
    #<IfDefine HAVE_PHP4>
    LoadModule php4_module     modules/libphp4.so  
    #</IfDefine>

    Inspired by lookin at Lhadatt's config And some other posts.
 
Last edited:
Now im still waiting on tech support to get back to me.
Its always nice to know if theres a cleaner solution.

Well the above fix will work if you start apache using the following methods:

/usr/sbin/httpd

or

apachectl start

someone on boards mentioned that DA uses:
/usr/local/etc/rc.d/httpd start (this does not work 4 me right now)

The control panel cant start the process either. However it can stop it.

Because of the custom configs. Not sure why that would make a difference in this case.
 
Last edited:
Scouring the forums I found donavan's explenation.

Though the post seems to be outdated, It does make sense in a way. Has this been fixed?
 
Can you elaborate on the mod_perl issue and its resolution?
I have the same problem and am curious to find the source before I contact support.

Thanks
 
Here is the email I got from support:

Ok, mod_perl was the problem. I tried compiling it several different ways, but it kept on bringing down apache (without any error messages).
I've changed the "AddModule mod_perl.c" line.. to "#AddModule mod_perl.c". It's deactivation will not affect cgi scripts at all (they use suexec)

Thank you,.

Hope this helps.
 
Yeah that works or else you could of always rebuilt apache in da with:

/usr/local/directadmin/scripts/customapache.sh

Good luck though.
 
Back
Top