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.

Problem with htaccess and php_value

Discussion in 'General Discussion' started by Skie, Feb 7, 2007.

  1. Skie

    Skie Active Member

    Joined:
    Mar 27, 2003
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    I've recently switched to new servers and I've set everything that I know of to be the same as the old servers. However, php_value is not useable with the .htaccess file. If I try using it, I get a 500 Internal Server Error and the following line within the error_log:

    Code:
    [Wed Feb  7 18:17:54 2007] [alert] [client 1.2.3.4] /home/user/public_html/.htaccess: Invalid command 'php_value magic_quotes_gpc 0', perhaps mis-spelled or defined by a module not included in the server configuration
    I'm want to allow the users to use the .htaccess file to modify some PHP values for specific websites. Specifically, magic_quotes_gpc for this one customer. Magic quotes are on based on the php.ini file, but they need it to be off for certain accounts. They were able to turn it off on the old server, but it's not working on the new server.

    Any idea of how I can allow them to use php_value? I've even tried using "php_value magic_quotes_gpc off" and "php_value magic_quotes_gpc = off" and nothing seems to help.
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The VirtualHost needs:
    Code:
    AlowOverrides Options
    
    Otherwise, you cannot configure PHP via .htaccess
     
  3. Skie

    Skie Active Member

    Joined:
    Mar 27, 2003
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    I tried adding AllowOveride Options (and even All) to the VirtualHost for the particular domain in question, but that didn't seem to make a difference. I still get the same error. Did I perhaps not install a needed module or something?
     
  4. brendanrtg

    brendanrtg Well-Known Member

    Joined:
    Oct 4, 2006
    Messages:
    311
    Likes Received:
    0
    Trophy Points:
    16
    I think what he meant was server-wide under httpd.conf?
     
  5. Skie

    Skie Active Member

    Joined:
    Mar 27, 2003
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    There's already a block of code towards the top under the first DocumentRoot that has:

    Code:
    <Directory />
    Options All
    AllowOverride All
    </Directory>
    
    I've even tried adding the AllowOverride outside of any block of code and it still makes no difference.
     
  6. brendanrtg

    brendanrtg Well-Known Member

    Joined:
    Oct 4, 2006
    Messages:
    311
    Likes Received:
    0
    Trophy Points:
    16
    #6 brendanrtg, Feb 10, 2007
    Last edited: Feb 10, 2007
  7. Skie

    Skie Active Member

    Joined:
    Mar 27, 2003
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    No, as I said, it's right under the very first DocumentRoot. It's not within any VirtualHost. This is there be default, I never added it and it's on all servers (even ones where the .htaccess file works properly).
     
  8. Skie

    Skie Active Member

    Joined:
    Mar 27, 2003
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    After some digging around, I came across another mention of this same problem. It turns out that if PHP is used as a CGI, various .htaccess commands like php_value, php_admin_value, php_flag, or php_admin_flad will not work. I changed PHP to be a module instead of CGI and everything works now.
     
Loading...

Share This Page