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.

Redirect setup, Syntax error of .htaccess, Invalid command 'suPHP_ConfigPath'

Discussion in 'General Discussion' started by xman888, Apr 21, 2010.

  1. xman888

    xman888 Well-Known Member

    Joined:
    Nov 23, 2005
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    How would I set up this redirect in cpanel:

    mydomain.tld/start to:
    Code:
    https://www.mydomain.tld/order/signup.php?clienttype=23&package=89
    Currently it gives the following error:
    Code:
    Apache detected an error in the Rewrite config.
    Syntax error on line 3 of /home/mydomain/public_html/.htaccess.........:
    [B]Invalid command 'suPHP_ConfigPath', perhaps mis-spelled or defined by a module not included in the server configuration[/B]
    Please try again.
    as a result of the unusual URL I am wanting to redirect to.

    Is it possible to set up such a redirect in cpanel?

    Kind regards,
    Anthony
     
    #1 xman888, Apr 21, 2010
    Last edited by a moderator: Sep 13, 2010
  2. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Your error has nothing to do with your rewrite ....

    Apparently you are trying to set the PHP.INI path from your .htaccess file but you either A) are not running SuPHP or B) have SuPHP configuration overrides limited or turned off or B) wrote an invalid command for these.

    You have to be using SuPHP in order to have a suPHP_ConfigPath command and even then you would have to compile to allow that
    to be placed in .htaccess files (not really recommended incidentally)
     
  3. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    What is the output of the following 2 commands:

    You seem to be having an invalid command in .htaccess OR SuPHP is not turned ON on your server itself.
     
  4. xman888

    xman888 Well-Known Member

    Joined:
    Nov 23, 2005
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    Hello madaboutlinux,

    Thanks for the reply.

    I got my host to sort it out.

    Kind regards,
    Anthony
     
  5. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Use IfModule sections to wrap Apache directives for dynamically-loaded (DSO) modules

    Code:
    Syntax error on line $number of /home/$username/public_html/.htaccess:
    Invalid command 'suPHP_ConfigPath', perhaps misspelled or defined by a module not included in the server configuration
    To avoid difficulty like that seen by the aforementioned error detail, please ensure to use IfModule sections to wrap directives for dynamically-loaded Apache (DSO) modules such as suPHP. For usage information I recommend referring to the official Apache/httpd documentation:

    To help determine which modules are compiled-in (static) or DSO (shared), please consider the following methods:
    • The following command will output a list of Apache modules that are statically compiled-in:
      Code:
      # /usr/local/apache/bin/httpd -l
    • The following command should list any DSO modules that may be installed in the default path:
      Code:
      # find /usr/local/apache -maxdepth 2 -type f -regex '.*\(libexec\|modules\)/.*\.so' -print | sort
    • Both of the following commands will list all loaded modules and indicate if each is static (compiled-in) or shared (DSO); this will work for Apache version 2.2, may work for Apache version 2.0, but may not work for the End-of-Life (EOL) Apache version 1.3:
      Code:
      # /usr/local/apache/bin/httpd -M
      # /usr/local/apache/bin/httpd -t -D DUMP_MODULES

    When the syntax check is performed, only statically-compiled-in modules are loaded unless the custom configuration file happens to load the needed module. If performing a syntax check and no configuration file is specified, the syntax check is performed on the main Apache configuration "httpd.conf" file, which should always load all required DSO modules and included configuration files, like php.conf that loads the suPHP module. However, when a syntax check is performed on other Apache configuration files, such as .htaccess files, it is normal to expect that they might not load the same modules or include the same configuration files that are normally handled by the main Apache configuration "httpd.conf" file. When using the Apache "httpd" binary to test configuration files through a syntax check it is dependent upon the specified configuration file to load any required modules, thus when a specified .htaccess file attempts to use a directive for a module that is not loaded, such as suPHP, you will see a syntax error unless the directive is wrapped within an IfModule section.

    Here is are a few examples of what could be used to safely wrap a custom suPHP directive within an IfModule section:
    • Code:
      <IfModule mod_suphp.c>
      suPHP_ConfigPath /full/path/to/directory
      </IfModule>
    • Code:
      <IfModule mod_suphp.c>
      suPHP_ConfigPath /usr/local/lib
      </IfModule>
    • Code:
      <IfModule mod_suphp.c>
      suPHP_ConfigPath /home/$username/public_html
      </IfModule>

    To perform the syntax check that is seen when a redirect is setup via cPanel, the path to your configuration file, specifically the path to your custom Apache .htaccess file, is passed to the "httpd" binary. The following command may be used to perform a syntax check via root SSH access; in this example please replace "$username" with the actual cPanel account username and ensure the file path matches the location of the applicable Apache .htaccess file to be tested:
    Code:
    # /usr/local/apache/bin/httpd -t -f /home/$username/public_html/.htaccess
    For comparison and testing purposes, any of the following commands may be used to perform a syntax check on the main Apache configuration file:
    Code:
    # /usr/local/apache/bin/apachectl configtest
    # /usr/local/apache/bin/httpd -t
    # /usr/local/apache/bin/httpd -t -f /usr/local/apache/conf/httpd.conf
     
Loading...

Share This Page