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.
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.
The file you should put in your root folder is not
php.ini
, but.htaccess
. Be sure it contains this line: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.
In their cpanel Software/Servces there is a php.ini QuickConfig that will allow to change pretty much any php setting.
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.
If you have cPanel access you can change the settings using php.ini Quick Config under Software/Service.
Darko is spot on and you will find php.ini QuickConfig under Software / Services in CPanel.
You can access your CPanel @ http://cpanel.yourdomain.com
You must also have administrator credentials to access CPanel.
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 ofphp.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 hostgatorI using hostgator, try my solution:
Insert more line in your .htaccess file: must replace “username” by your user account hosting.
If you have an php.ini file, insert more line in your php.ini file:
if not, you can create a new php.ini file with code below:
Note: Your .htaccess file and php.ini file must be put in your root folder(top level folder in your hosting).