Create php.ini
and .htaccess
files outside of your document root.
I will assume your document root is /home/yourusername/public_html
then do the following:
Create php.ini
file outside of the document root: /home/yourusername/php.ini
.
Inside your php.ini
file turn register_globals OFF:
register_globals = Off
Create .htaccess
file outside of the document root: /home/yourusername/.htaccess
.
Inside your .htaccess
file put:
SetEnv PHPRC /home/yourusername/php.ini
Create a phpinfo.php
file inside your document root: /home/yourusername/public_html/phpinfo.php
Inside your phpinfo.php
file put this inside php tags: phpinfo();
Visit phpinfo.php
and check the Loaded Configuration File
- it should point to the new file.