The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

htscanner enabled but not working !!!

Discussion in 'General Discussion' started by activa, Oct 4, 2011.

  1. activa

    activa Well-Known Member

    Joined:
    May 23, 2006
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    i have installed the htscanner (v1.0.0 and 0.0.9) with PEAR and from binary source , but is not working . with php -m i get htscanner listed with the loaded modules , also i have added the php.ini section .

    Tested with php 5.2.17 and php 5.3.6 and the same result .

    the htscanner not detecting the .htaccess or is not working i dont know what is the probleme !

    any idea or road to go (invistigate)?
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    What specifically do you have in the /usr/local/lib/php.ini file for htscanner? Also, does the site have its own php.ini file? If so, what is in that file for htscanner? Finally, what is in .htaccess for the user that isn't parsing?
     
  3. activa

    activa Well-Known Member

    Joined:
    May 23, 2006
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    Code:
    [htscanner]
    extension="htscanner.so"
    
    ; The configuration file htscanner needs to scan for php_* directives
    htscanner.config_file=".htaccess"
    
    ; The fallback docroot when htscanner can't determine the current docroot
    htscanner.default_docroot="../public_html"
    htscanner.default_ttl=300
    
    ; Stop when an error occured in RINIT (no document root, cannot get path_translated,...)
    htscanner.stop_on_error = 0
    
    ; Warn when an option cannot be set
    htscanner.verbose = 0
    
    i have changed htscanner.default_docroot to "/" and "/home/" and so other directory format but the same result .

    No php.ini in the website .

    Code:
    php_value memory_limit 128M
    and others has

    Code:
    php_value engine off

    note when i change to php to DSO no error found , the website work perfectly .
     
    #3 activa, Oct 5, 2011
    Last edited: Oct 5, 2011
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,478
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Looks like it found one:
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Per this discussion about htscanner:

    Web Hosting Talk - View Single Post - htscanner + SuPHP

    This specifically means you cannot use .htaccess files for these directives. You would either need to put the <IfModule mod_php5.c>setting</IfModule> around the settings or you would need to compile mod_htscanner2.c into Apache using apxs.

    I put the mod_php5.c IfModule around my memory_limit value in .htaccess on a machine with htscanner installed, and it works just fine. Note I am using suPHP, so Apache ignores the mod_php5 directives, which allows the php.ini to pass them to htscanner to read. Here is my phpinfo showing this working for memory_limit:

    phpinfo with htscanner

    Here are the contents of my .htaccess file:

    Code:
    <IfModule mod_php5.c>
    php_value memory_limit 228M
    </IfModule>
     
  6. activa

    activa Well-Known Member

    Joined:
    May 23, 2006
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    We know that with <IfModule mod_php5.c> work but please READ THIS :

    so the .htaccess without IfModule mod_php5.c should work perfectly with htscanner , and for that reason why htscanner was BORN

     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You need to use apxs to compile mod_htscanner.c for Apache by downloading the mod_htscanner and compiling it. If you knew this was necessary, then I'm uncertain why it wasn't noted in this thread prior to my post.

    Again, you either need to use the module tags I mentioned under suPHP/FCGI to force Apache to not try to parse the flags improperly or compile the Apache module mod_htscanner. There are online tutorials on how to use apxs to compile Apache modules. If you have any questions on how to do so after trying, please let us know.
     
  8. activa

    activa Well-Known Member

    Joined:
    May 23, 2006
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    I have installer the htscanner with the fallowing command

    Code:
    tar xzf htscanner-<version>.tgz
    cd htscanner-<version>
    phpize
    ./configure
    make
    make install
    is this not correct ?

    also how i can use the mod_htscanner.c ?
     
    #8 activa, Oct 11, 2011
    Last edited: Oct 11, 2011
  9. grvulture

    grvulture Registered

    Joined:
    Nov 4, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hello,
    I have the same problem, so I compiled mod_htscanner.c with apxs using:
    apxs -i -a -c mod_htscanner.c

    and I got this error:
    Code:
    /usr/local/apache/build/libtool --silent --mode=compile gcc -prefer-pic -m64 -fPIC -DPIC  -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -m64 -fPIC -DPIC -pthread -I/opt/pcre/include -I/usr/local/apache/include  -I/usr/local/apache/include   -I/usr/local/apache/include   -c -o mod_htscanner.lo mod_htscanner.c && touch mod_htscanner.slo
    mod_htscanner.c:5: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âhtscanner_moduleâ
    mod_htscanner.c:14: warning: initialization from incompatible pointer type
    mod_htscanner.c:15: warning: initialization from incompatible pointer type
    mod_htscanner.c:19: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âhtscanner_moduleâ
    apxs:Error: Command failed with rc=65536
    I uploaded mod_htscanner.c using FileZilla as ASCII, and then as Binary (just in case), no result.
    What to do?
    Thank you in advance for any help! :)
     
  10. activa

    activa Well-Known Member

    Joined:
    May 23, 2006
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    Up again , still no way to make it working ...

    any new tips or a success case or way that get it working ?
     
  11. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Why don't you simply put the directive flags around it like I suggested? As I stated in the post where I discussed that, Apache ignores the mod_php5 directives, which allows the php.ini to pass them to htscanner to read under suPHP or FCGI. I believe you haven't even tried putting those directives to see it works in .htaccess at that point under suPHP:

    Code:
    <IfModule mod_php5.c>
    php_value memory_limit 228M
    </IfModule>
    Can you please try this out on an account using suPHP to see that it does work and bypass the suPHP restrictions that are preventing it from working otherwise?

    I don't understand why it would be an issue to put those directives around the settings if that's what it takes to get it working.
     
  12. activa

    activa Well-Known Member

    Joined:
    May 23, 2006
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    Worked for me with this how to

    /http://admin-tips.com/20/install-htscanner-in-cpanel-.html
     
  13. TheBang

    TheBang Registered

    Joined:
    Oct 19, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    These commands only compile and install the htscanner.so PHP extension. The htscanner.so extension allows you to use php_flag/value directives in any file you specify. However, if the file you want to use is .htaccess, then you must enclose the php directives within IfModule statements OR you must compile and install the mod_htscanner Apache module. mod_htscanner is a dummy handler that will make Apache ignore the php_* directives and pass them through without error to be handled by the htscanner.so extension. Compiling and installing mod_htscanner is a separate step from the above build directions for htscanner.so extension.

    Note that mod_htscanner.c is an Apache 1.x module. If you are running Apache 2.x, you must compile and use mod_htscanner2.c instead. If you try to compile mod_htscanner.c on an Apache 2.x installation, you will get the above error message.

    The other thing to note is the value of the .ini configuration variable: "htscanner.default_ttl". The value of this is usually set to 300 seconds in the example. This means that htscanner will cache the results it finds for 300 seconds, and will not scan the designated files for new php_* directives for that many seconds. That means if you make a change to your file, you may not see the change in that php value appear for up to 5 minutes. You may want to choose another value for "htscanner.default_ttl" like 5 or 10 seconds.
     
    #13 TheBang, Oct 19, 2012
    Last edited: Oct 19, 2012
Loading...

Share This Page