Moodle
  1. Moodle
  2. MDL-26182

Notice: Undefined index: SCRIPT_NAME in /var/www/moodle/testing/lib/setuplib.php on line 723

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.2
    • Component/s: General
    • Labels:
      None
    • Environment:
      CentOS 5.5, Linux 2.6.18-194.el5PAE, nginx 0.8.53, php 5.3.4 as FastCGI
    • Database:
      Any
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      16216

      Description

      This message always displays on every page if open debug mode.

      I searched it and found other php product said the problem can be solved by setting variables_order=EGPCS in php.ini. I tried but did not work. variables_order always be GPCS. The official php doc (http://php.net/manual/en/ini.core.php) says "In both the CGI and FastCGI SAPIs, $_SERVER is also populated by values from the environment; S is always equivalent to ES regardless of the placement of E elsewhere in this directive." It seems that GPCS is equal to EGPCS in my server

        Issue Links

          Activity

          Hide
          Sunner Sun added a comment -

          Additional info:

          The site works well. It seems that nothing is affected by this notice.

          Show
          Sunner Sun added a comment - Additional info: The site works well. It seems that nothing is affected by this notice.
          Hide
          Petr Škoda added a comment -

          Hello,
          the problem is that nginx is not 100% Apache compatible, somebody with access to some servers has to add workarounds for all differences in the $_SERVER global for all supported operating systems and write some docs explaining necessary settings.

          Petr

          Show
          Petr Škoda added a comment - Hello, the problem is that nginx is not 100% Apache compatible, somebody with access to some servers has to add workarounds for all differences in the $_SERVER global for all supported operating systems and write some docs explaining necessary settings. Petr
          Hide
          Petr Škoda added a comment -

          I have found several pages describing a bug where SCRIPT_NAME is missing, maybe this could help you:
          http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=608987

          Show
          Petr Škoda added a comment - I have found several pages describing a bug where SCRIPT_NAME is missing, maybe this could help you: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=608987
          Hide
          Sunner Sun added a comment -

          Thank you, sokdak!

          After adding "fastcgi_param SCRIPT_NAME $fastcgi_script_name;" in nginx's configure, the problem is solved.

          If the docs you mentioned above needs any info about nginx, I'd like to help.

          I think, this issue can be closed.

          Show
          Sunner Sun added a comment - Thank you, sokdak! After adding "fastcgi_param SCRIPT_NAME $fastcgi_script_name;" in nginx's configure, the problem is solved. If the docs you mentioned above needs any info about nginx, I'd like to help. I think, this issue can be closed.
          Hide
          Petr Škoda added a comment -

          I have added the info directly into moodle code, see the linked PULL request.

          Thanks for the report and cooperation.

          Petr

          Show
          Petr Škoda added a comment - I have added the info directly into moodle code, see the linked PULL request. Thanks for the report and cooperation. Petr
          Hide
          Dongsheng Cai added a comment -

          Another nginx tip of running moodle https: Moodle complains sslonlyaccess error, it is actually because the $_SERVER['HTTPS'] is not set by nginx by default, have to add "fastcgi_param HTTPS on;" to "server{}" section.

          Show
          Dongsheng Cai added a comment - Another nginx tip of running moodle https: Moodle complains sslonlyaccess error, it is actually because the $_SERVER ['HTTPS'] is not set by nginx by default, have to add "fastcgi_param HTTPS on;" to "server{}" section.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          I keep this open for consideration of last comment from Dongsheng. Should we introduce another check for that?

          Feel free to close it if no further action is necessary as far as the original problem (SCRIPT_NAME check + tip) has been already integrated.

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - I keep this open for consideration of last comment from Dongsheng. Should we introduce another check for that? Feel free to close it if no further action is necessary as far as the original problem (SCRIPT_NAME check + tip) has been already integrated. Ciao
          Hide
          Petr Škoda added a comment -

          reclosing, going to file new issue for the ssl issue

          Show
          Petr Škoda added a comment - reclosing, going to file new issue for the ssl issue

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: