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.

Can you disable registered globals for just one account?

Discussion in 'General Discussion' started by DWHS.net, Apr 15, 2011.

  1. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    I have a customer using Drupal and they need global registers turned off just for there one account.

    Is this possible with a custom php.ini file in their domain or with htaccess?

    Thank you,

    Charles
     
  2. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello Charles,

    It depends on the PHP build. If PHP is build as Apache you can turn off register globals via htaccess. If PHP is build as suphp you need to use custom php.ini for the purpose.
     
  3. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    Awesome thanks, I would need the custom php.ini file.

    Thanks again!
     
  4. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello Charles,

    You are entirely welcome. You can always copy the server's php.ini to user's public_html or the required directory!
     
  5. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    I did exactly that but they said it's not taking. I heard adding this to the htaccess will work: AddType x-mapp-php5 .php

    I give that a try.
     
  6. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hey Charles,

    Did you check the phpinfo of the domain to check from where the domain is taking php.ini?

    If it is not working you can use the below given steps to make the domain take php.ini from public_html of the domain.

    Create a file called php5.cgi under the public_html directory of the user. The php5.cgi must contain the following code in it.

    #!/bin/sh
    exec /usr/local/cpanel/cgi-sys/php5 -c /home/username/php.ini

    chmod 755 /home/username/public_html/php5.cgi
    chown username.username /home/username/public_html/php5.cgi

    Create a .htaccess in the directory you need custom php5 configuration working with the following code in it.

    Options All -Indexes
    AddHandler application/x-httpd-php5 .php
    Action application/x-httpd-php5 /php5.cgi

    Make sure both .htaccess and php5.cgi are in the document root.

    After that you can test it by putting a phpinfo() file in that directory and accessing it via browser. It should show the path to php.ini as /home/username/php.ini
     
  7. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    Wow great tip, I will definably try this if they still need help.
     
  8. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hey Charles,


    Okay ! This will work for sure. Cheers!
     
Loading...

Share This Page