problems installing on RedHat 8.0

problems installing on RedHat 8.0

von Marius Onica -
Anzahl Antworten: 12
After creating the tables without problem, I'm blocked in the Configure Variables window (where I must indicate the smtp server etc). I click Save Changes, but the window reloads itself. No possibilities to define the admin user and to finish the setup, no error messages. Any ideas ?

TIA, Marius

P.S. version 1.05; on RH 7.3 the same version installed without problems
Als Antwort auf Marius Onica

Re: problems installing on RedHat 8.0

von Martin Dougiamas -
Nutzerbild von Core developers Nutzerbild von Documentation writers Nutzerbild von Moodle HQ Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers Nutzerbild von Testers
Exactly what version of PHP are you using?

There are some bugs in some recent versions of PHP that affect environment variables.

These PHP bugs can make some of Moodle's forms fail, because Moodle forms performs some security checks that require these variables.

If you can track down the problem I'd be grateful.
Als Antwort auf Martin Dougiamas

Re: problems installing on RedHat 8.0

von Marius Onica -
I'm working with the default RH 8.0 packages, i.e.
php 4.2.2-8.0.5 (probably for you 4.2.2 is significant), apache 2.0.40. I'll atache the php.ini file and an output of the phpinfo(), maybe it is relevent to you.

Thank's a lot,

Marius
Als Antwort auf Marius Onica

Re: problems installing on RedHat 8.0

von Martin Dougiamas -
Nutzerbild von Core developers Nutzerbild von Documentation writers Nutzerbild von Moodle HQ Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers Nutzerbild von Testers

Looks like all the environment variables are there ... mixed.gif

Edit admin/config.php and find this line:

    if (match_referer() && isset($HTTP_POST_VARS)) {

and change it to:

    if (isset($HTTP_POST_VARS)) {

Does that fix the problem?  sleepy.gif

Als Antwort auf Martin Dougiamas

Re: problems installing on RedHat 8.0

von Marius Onica -
It seems that apache 2.0 does not have the HTTP_REFERER variable, or it is not accesible from php.


Als Antwort auf Marius Onica

Re: problems installing on RedHat 8.0

von Martin Dougiamas -
Nutzerbild von Core developers Nutzerbild von Documentation writers Nutzerbild von Moodle HQ Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers Nutzerbild von Testers
That sounds astounding to me - are you sure? Perhaps it is this PHP/Apache2 bug.

In any case, a workaround to get you going would be to edit lib/weblib.php, find the match_referer function and insert this line as the first line of the function:
    return true;

You will lose a little security (from hypothetical hackers) but at least Moodle will be working until newer versions of PHP and/or Apache are out.
Als Antwort auf Marius Onica

Re: problems installing on RedHat 8.0

von Marius Onica -
Hi,

It seems that I solved the problem. In RH 8.0, in the php.ini script you must change the following:
short_open_tag=On (by default is Off)
register_globals=On (by default is Off).

Now the php guys recommend to let register_globals to off due to security reasons. So I changed in weblib.php all calls like
getenv("HTTP_REFERER") to $_SERVER[HTTP_REFERER]
getenv("SERVER_PROTOCOL") to $_SERVER["SERVER_PROTOCOL"]
getenv("HTTP_HOST") to $_SERVER["HTTP_HOST"]
getenv("SERVER_PROTOCOL") to $_SERVER["SERVER_PROTOCOL"]

I'm not sure about getenv("HTTPS") and getenv("PATH_INFO").

So, maybe in the future you will consider to change the default behaviour for these statements.

Thanks
Als Antwort auf Marius Onica

Re: problems installing on RedHat 8.0

von Dave Nuttall -

With version 1.0.4 of Moodle, I did NOT have to turn on "register_globals".

However, I know that based on working with PHP-Nuke/phpBB forums in lieu of the Splatt forums on Nuke, I had many problems that appeared to be globals related until I moved to the latest PHP 4.3.0-beta. 

I'm running on RedHat 8.0, but have compiled my own Apache 2.0.43 and PHP w/default MySQL for RH 8.0.

Als Antwort auf Marius Onica

Re: problems installing on RedHat 8.0

von Martin Dougiamas -
Nutzerbild von Core developers Nutzerbild von Documentation writers Nutzerbild von Moodle HQ Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers Nutzerbild von Testers
None of that should have been necessary.

Please see lib/setup.php - it globalises all those variables explicitly.
Als Antwort auf Martin Dougiamas

Re: problems installing on RedHat 8.0

von Marius Onica -
That means that without my modifications it should work ? (if my understanding is correct). But it didn't .
Als Antwort auf Marius Onica

Re: problems installing on RedHat 8.0

von Martin Dougiamas -
Nutzerbild von Core developers Nutzerbild von Documentation writers Nutzerbild von Moodle HQ Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers Nutzerbild von Testers
Yes, it should have worked without your modifications. I strongly suspect that what you did actually worked around the PHP/Apache bug with your particular versions of PHP and Apache (this is what I've been trying to say in my past posts). I'm using PHP 4.2.3 with register_globals off under Redhat 7.3) and it's working fine.

As for short_open_tag .... that defaults to OFF on Redhat 8.0??? Wow, that's going to break nearly every script out there! gemischt
Als Antwort auf Martin Dougiamas

Re: problems installing on RedHat 8.0

von khanh luu -

About the short_open_tag, has the change been made to version 1.06?

I'm thinking about installing this software on Redhat Linx 8.0 if it has already been changed, but if not then I'll just stick to Redhat 7.3

Als Antwort auf khanh luu

Re: problems installing on RedHat 8.0

von Martin Dougiamas -
Nutzerbild von Core developers Nutzerbild von Documentation writers Nutzerbild von Moodle HQ Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers Nutzerbild von Testers
Making that change would require making hundreds of edits. I may do it someday. In the meantime all you need to do is to create a small text file called .htaccess in the root folder of Moodle that contains this:

php_value short_open_tag 1
... and your problem is solved! (Also see the file lib/htaccess in the Moodle distribution)