Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-57127

PHP CSS parser runs out of memory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.2
    • 3.2
    • Themes
    • MOODLE_32_STABLE
    • MOODLE_32_STABLE
    • MDL-57127-master
    • Hide
      1. Use PHP 5.6
      2. Confirm that your memory_limit is set to 128MB
      3. Disable development mode
      4. Switch to Clean
      5. Switch to an RTL language
      6. Purge all caches
      7. Open your network tab
      8. Go to the home page
      9. Confirm that the styles come up
      10. Confirm that the request to styles.php/.../all-rtl did not fail
      Show
      Use PHP 5.6 Confirm that your memory_limit is set to 128MB Disable development mode Switch to Clean Switch to an RTL language Purge all caches Open your network tab Go to the home page Confirm that the styles come up Confirm that the request to styles.php/.../all-rtl did not fail

      When trying to change the language to a RTL language the PHP CSS parser runs out of memory. It tries to exceed the standard allocation size of 128mb as defined in the php.ini file which causes the server to return a 500 error.

      To replicate:

      • Make sure your php.ini file has the memory limit set to 128mb
      • Use clean theme
      • Install an RTL language pack
      • Make sure your cache is cleared so that parser needs to rebuild it
      • Change the language to the new RTL language

      To work around:
      Increase the memory limit in php.ini from 128mb to something larger

      The error in my apache logs is:
      [Thu Nov 24 02:07:31.101845 2016] [:error] [pid 11843] [client 10.0.2.2:64808] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home/vagrant/moodles/stable_master/moodle/lib/php-css-parser/Parser.php on line 701

      The error in the browser console is:
      http://<moodle_url>/stable_master/theme/styles.php/clean/1479953989/all-rtl

            fred Frédéric Massart
            ryanwyllie Ryan Wyllie
            Jun Pataleta Jun Pataleta
            Andrew Lyons Andrew Lyons
            Rajesh Taneja Rajesh Taneja
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.