Register_globals settings

Register_globals settings

by Helen Whitehead -
Number of replies: 6
I have been advised by my webhost to create a _custom_php_settings directory with a php.ini file in it with the appropriate settings

My questions are:

1. where do I create the _custom_php_settings directory - should it be in the moodle directory and is it exactly that format with the underscores? Do I need this and the php.ini in all subdirectories?

2. What should the php.ini file have in it?

is there more to it than

register_globals = 0
display_errors = 0

(Moodle 1.9.2+)

Helen
Average of ratings: -
In reply to Helen Whitehead

Re: Register_globals settings

by Alex DePena -
If your webhost is running apache (on linux), a way of controlling php settings is by putting a .htaccess file in the moodle root directory. The contents of this file would be apache directives in the form of:

php_value memory_limit 32M
php_value max_execution_time 60
php_flag register_globals Off
php_flag magic_quotes_gpc Off

You may also want to put a .htaccess file in your moodle/backup directory to increase execution time and memory limits only for backups. This is not at all necessary unless you have a large number of courses or some very big backup files.

It may be that your webhost is actually telling you to create a moodle/custom_php_settings directory with file moodle/custom_php_settings/php.ini in it. In this case the normal php.ini syntax would be used.


In reply to Alex DePena

Re: Register_globals settings

by Helen Whitehead -
Thank you for your response.

Yes it looks like they don't support .htaccess, this is the way I have to do it.

But I can't find a php.ini anywhere on the server and from what I've read it is a large file, which I have to edit and add to, rather than just containing those two lines. I have never edited a php.ini before and have no idea what the syntax would be or what a php.ini file looks like!
In reply to Helen Whitehead

Re: Register_globals settings

by Richard Enison -
HW,

Your web host is the world's expert on where to put the custom php.ini file on their servers. For example, according to Brad Henry whom I just answered in another thread in this forum, at GoDaddy the custom php.ini files go in your main (default, root, top level) directory.

As to what to put in it, I suspect, as I told BH, that you might only need to put into your custom php.ini file the lines that are unique to your site, that is, that are different from the default settings that you host has in its ini file for all their clients. You cannot see that file because you don't have access to it, which is why you couldn't find a php.ini file.

I can tell you that what AD said is true about .htaccess files is correct, but the format of the lines in his post do not apply to php.ini. A sample php.ini file is attached to my post in the other thread. Here is a link to it: http://moodle.org/file.php/5/moddata/forum/15/458756/php.ini.

RLE
In reply to Helen Whitehead

Re: Register_globals settings

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Your host has register_globals *on* ??? Scary!
In reply to Howard Miller

Re: Register_globals settings

by Richard Enison -
HM,

I would not infer that from HW's original post. It could be that she read in the Moodle docs that register_globals should be off for Moodle, so she wanted to put that in her custom php.ini file just in case.

RLE