how to turn off Register_globals in php.ini? hostgator wordpress server

I am running an ecommerce theme on wordpress on a hostgator server, and coming up with this error.

Security warning: set the value
register_globals in the php ini to Off !! This theme will not work correctly otherwise.

Read More

I can’t find the php.ini in any of the folders. I tried creating a file with the added command and putting it in root as suggested via google, with no luck.

Any recommendations?otherwise.

Related posts

Leave a Reply

7 comments

  1. The file you should put in your root folder is not php.ini, but .htaccess. Be sure it contains this line:

    php_flag register_globals off
    

    If that still doesn’t work or generates a 500 Internal Server Error then you’ll have to contact HostGator and see what they say.

  2. My research lead me to find that the php.ini file is normally found/stored in the home directory of your cpanel. This setting is commonly set to “on” as a default server setting and can sometimes be considered a security risk when left enabled – depending on certain scripts.

    On or about line 365 you will see the setting for the php Globals. Simply change it from “on” to “off”.

    Occasionally you may find that there is not a php.ini file located in the home directory. If you find that to be the case, you can go to the cpanel home page and within the Software/Services area click on the php.ini EZConfig icon (for HostGator hosting – other hosting companies may have another name for this). This open another page and you will see the setting located about 1/2 down the list. Click the radio button choice of off.

  3. Sometimes making the change in .htaccess is not sufficient. Hostgator has a little elaborate process and it can be irritating some times.

    You will need to add the default php.ini file that Hostgator provides to your root. And then add the .htaccess with an entry for the address of php.ini to the www doc root.

    For detailed steps and downloading these docs(php.ini and .htaccess file)read my blog on How to turn off register_globals in hostgator

  4. I using hostgator, try my solution:
    Insert more line in your .htaccess file: must replace “username” by your user account hosting.

    <IfModule mod_suphp.c>
    suPHP_ConfigPath /home/username
    <Files php.ini>
    order allow,deny
    deny from all
    </Files>
    </IfModule>
    

    If you have an php.ini file, insert more line in your php.ini file:

    register_globals = Off // O in "Off" is uppercase text
    

    if not, you can create a new php.ini file with code below:

    register_globals = Off // O in "Off" is uppercase text
    

    Note: Your .htaccess file and php.ini file must be put in your root folder(top level folder in your hosting).