<![CDATA[ Setting register_globals to OFF - My Forums]]> https://forums.modx.com/thread/?thread=71530 <![CDATA[Setting register_globals to OFF]]> https://forums.modx.com/thread/71530/setting-register-globals-to-off#dis-post-399001
First, is there somewhere that I can download a php.ini file for Modx 2.0.06-pl2 with all of the correct settings already setup? If not, what do I need to do in my default php.ini file?

Thanks!]]>
redpanda Nov 03, 2011, 09:57 PM https://forums.modx.com/thread/71530/setting-register-globals-to-off#dis-post-399001
<![CDATA[Re: Setting register_globals to OFF]]> https://forums.modx.com/thread/71530/setting-register-globals-to-off#dis-post-519931
After putting this php.ini at the root of the website,
[PHP]
register_globals = Off
I observed with phpinfo.php that the local value of register_globals had been correctly changed to Off.

After putting phpinfo.php inside the manager folder, I can confirm that the settings in php.ini were correctly transmitted from the root of the website to this subfolder.

The master value is still On. I assume this being normal, as the master value is probably thus set by the web hosting.

But some strange thing is that despite the local value should supersede the master value, the warning still displays in MODx, even if I empty MODx cache, as well as the browser cache.

Any idea?]]>
Jul Feb 04, 2015, 08:52 AM https://forums.modx.com/thread/71530/setting-register-globals-to-off#dis-post-519931
<![CDATA[Re: Setting register_globals to OFF]]> https://forums.modx.com/thread/71530/setting-register-globals-to-off#dis-post-399273 redpanda Nov 07, 2011, 11:48 AM https://forums.modx.com/thread/71530/setting-register-globals-to-off#dis-post-399273 <![CDATA[Re: Setting register_globals to OFF]]> https://forums.modx.com/thread/71530/setting-register-globals-to-off#dis-post-399269
Depending on your host configuration, you may need to add a custom php.ini file to every folder.

Also I would recommend using: www.tips-scripts.com/php_ini to generate the custom php.ini file as it uses your host's default as the base and applies your changes.

Who is the hosting provider?]]>
AMDbuilder Nov 07, 2011, 11:12 AM https://forums.modx.com/thread/71530/setting-register-globals-to-off#dis-post-399269
<![CDATA[Re: Setting register_globals to OFF]]> https://forums.modx.com/thread/71530/setting-register-globals-to-off#dis-post-399216
Thanks.]]>
redpanda Nov 06, 2011, 09:44 PM https://forums.modx.com/thread/71530/setting-register-globals-to-off#dis-post-399216
<![CDATA[Re: Setting register_globals to OFF]]> https://forums.modx.com/thread/71530/setting-register-globals-to-off#dis-post-399007
Thank you for the explanation. I spoke with my host and I need to make the change within the php.ini file. So in this case, what should I do?

Thank you!]]>
redpanda Nov 03, 2011, 11:09 PM https://forums.modx.com/thread/71530/setting-register-globals-to-off#dis-post-399007
<![CDATA[Re: Setting register_globals to OFF]]> https://forums.modx.com/thread/71530/setting-register-globals-to-off#dis-post-399003
php_flag register_globals Off


Be careful; you may also need to turn off magic_quotes_gpc, as this will cause extra / characters to be added to all quote marks in data saved to the database if it's on.

If you are using PHP as a CGI instead of an Apache module, you'll need to have a custom php.ini file in the site's root and the /manager directory with the necessary directive. The proper way to do this is to have a full copy of the default php.ini file with the desired changes added, but a file with just the required directives will do the job. Such a custom file needs to be in every folder that has a .php file that is run; MODx only actually runs two, the root index.php for the front-end and the index.php file in the /manager. All the rest of the MODx .php files are included by those two, so only those two directories need a custom php.ini file, unless you have custom AJAX scripts or something of the sort being run.

It's actually a very bad practice of your hosting to have either of these set to ON. They are being deprecated by PHP and most likely won't even exist in the next major version, since register_globals can cause security problems, and magic_quotes is not very good at adding any security, mostly only providing a false impression of doing so and otherwise just causing problems for properly written code that is secure.]]>
sottwell Nov 03, 2011, 10:30 PM https://forums.modx.com/thread/71530/setting-register-globals-to-off#dis-post-399003