Moodle

After updating admin screen is blank

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8
  • Fix Version/s: 1.9.4
  • Component/s: MNet
  • Labels:
    None
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

I updated via cvs and now when I go to /admin I get this:

Notice: Use of undefined constant T_COMMENT - assumed 'T_COMMENT' in /srv/www/alphamoodle/moodle/admin/mnet/MethodTable.php on line 15

Fatal error: Call to undefined function token_get_all() in /srv/www/alphamoodle/moodle/admin/mnet/MethodTable.php on line 77

Just a FYI for you.

Activity

Hide
Martín Langhoff added a comment -

Apparently you don't have the PHP Tokenizer. Now, the tokenizer is bundled with PHP since v4.2 and ON by default with PHP since v 4.3. So questions follow:

  • what version of PHP are you running, and where did you get it from?
  • did you enable any Moodle Network functionality? (from your report I suspect no, but still)

To Donal - can we avoid running this code if the tokenizer isn't there?

Show
Martín Langhoff added a comment - Apparently you don't have the PHP Tokenizer. Now, the tokenizer is bundled with PHP since v4.2 and ON by default with PHP since v 4.3. So questions follow:
  • what version of PHP are you running, and where did you get it from?
  • did you enable any Moodle Network functionality? (from your report I suspect no, but still)
To Donal - can we avoid running this code if the tokenizer isn't there?
Hide
Lori Bakken added a comment -

We are running php 5.1.2 in SLES 10

As in Network functionality, what do you mean?

Show
Lori Bakken added a comment - We are running php 5.1.2 in SLES 10 As in Network functionality, what do you mean?
Hide
Martín Langhoff added a comment -

Hmmm. May be related to this http://developer.novell.com/wiki/index.php/SUSE_Linux_Porting_Advisories#SLES_9_to_SLES_10:_PHP_Development

Maybe it's just that newer versions of PHP have changed some aspects of the Tokenizer. Grumble.

Show
Martín Langhoff added a comment - Hmmm. May be related to this http://developer.novell.com/wiki/index.php/SUSE_Linux_Porting_Advisories#SLES_9_to_SLES_10:_PHP_Development Maybe it's just that newer versions of PHP have changed some aspects of the Tokenizer. Grumble.
Hide
Martín Langhoff added a comment -

Scratch that – we are already handling that. You seem to be missing the Tokenizer. SuSE seems to not install it automatically.

Can you install a package called php5-tokenizer?

We need to

  • add it to environment
  • add checks for extension_loaded('tokenizer') for cases where it's not there.
Show
Martín Langhoff added a comment - Scratch that – we are already handling that. You seem to be missing the Tokenizer. SuSE seems to not install it automatically. Can you install a package called php5-tokenizer? We need to
  • add it to environment
  • add checks for extension_loaded('tokenizer') for cases where it's not there.
Hide
Donal McMullan added a comment -

I guess your PHP must have been compiled with the --disable-tokenizer flag.
That's unexpected!
The PHP documentation led me to believe that the tokenizer would be available on every PHP system that Moodle supports, so I didn't couch the function calls in "if function_exists" type blocks.

IIRC, the tokenizer isn't crucial, even to the Moodle-Networking feature - I'll revise that today.

The network functionality is a new feature that allows two (or more) Moodle servers to contact each other and do cool stuff like single-sign-on, enrolment of users from the local system in remote courses, etc.

Show
Donal McMullan added a comment - I guess your PHP must have been compiled with the --disable-tokenizer flag. That's unexpected! The PHP documentation led me to believe that the tokenizer would be available on every PHP system that Moodle supports, so I didn't couch the function calls in "if function_exists" type blocks. IIRC, the tokenizer isn't crucial, even to the Moodle-Networking feature - I'll revise that today. The network functionality is a new feature that allows two (or more) Moodle servers to contact each other and do cool stuff like single-sign-on, enrolment of users from the local system in remote courses, etc.
Hide
Lori Bakken added a comment -

That was exactly it. It is was not installed. I didn't even know that existed Thanks for the quick help!

Show
Lori Bakken added a comment - That was exactly it. It is was not installed. I didn't even know that existed Thanks for the quick help!
Hide
Donal McMullan added a comment -

I just committed an update to admin/mnet/adminlib.php which should address this issue for sites with the tokenizer switched off.

The tokenizer just inspects code and adds info from the docblocks for methods and functions to the database so we can provide that info as part of XML-RPC introspection. If you don't have the tokenizer, Moodle networking should still work for you without any problems.

Show
Donal McMullan added a comment - I just committed an update to admin/mnet/adminlib.php which should address this issue for sites with the tokenizer switched off. The tokenizer just inspects code and adds info from the docblocks for methods and functions to the database so we can provide that info as part of XML-RPC introspection. If you don't have the tokenizer, Moodle networking should still work for you without any problems.
Hide
Martín Langhoff added a comment -

As per above, we need to have it checked in admin/environment

Show
Martín Langhoff added a comment - As per above, we need to have it checked in admin/environment
Hide
Nicolas Connault added a comment -

This bug is rearing its ugly head in today's checkout of 1.9.4. I have just upgraded to PHP 5.2.8 with all its extensions (including tokenizer, mbstring, xmlrpc and openssl). Each time I hit admin/index.php I get an infinitely-loading page of notices just like the one reported here.

Show
Nicolas Connault added a comment - This bug is rearing its ugly head in today's checkout of 1.9.4. I have just upgraded to PHP 5.2.8 with all its extensions (including tokenizer, mbstring, xmlrpc and openssl). Each time I hit admin/index.php I get an infinitely-loading page of notices just like the one reported here.
Hide
Nicolas Connault added a comment -

I just solved this: Some of my extensions (namely zlib and pdo) were installed in i586 version instead of 86_64 like the others. When I installed the correct version, things worked ok. I assume that the tokenizer extension (which was correct) did not load because one of these extensions failed to load previously

Show
Nicolas Connault added a comment - I just solved this: Some of my extensions (namely zlib and pdo) were installed in i586 version instead of 86_64 like the others. When I installed the correct version, things worked ok. I assume that the tokenizer extension (which was correct) did not load because one of these extensions failed to load previously
Hide
Tim Hunt added a comment -

Considering how long this has been marked fixed without comment, I'm closing it.

Show
Tim Hunt added a comment - Considering how long this has been marked fixed without comment, I'm closing it.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: