No announcement yet.

Error on searches

  • Filter
  • Time
  • Show
Clear All
new posts

  • Error on searches

    A few of my users are reporting that they are receiving an error message when performing long text searches, the following text appears.

    Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 16 bytes) in /path/to/forums/search.php on line 870
    I see that the byte count is 8MB, how do I alter the allowed memory size for searches.

    This problem only seems to of appeared after upgrading my PHP version to v5.2.2

  • #2
    Thats a very low php memory limit, as the default in 5.2 should be 16MB

    You need to edit your php.ini and edit the memory_limit option.


    • #3
      Thanks Zachery, where do I find the php.ini file


      • #4
        Thats a pretty loaded question, what is your OS?

        For linux:
        locate php.ini
        find php.ini

        Start > Search > php.ini


        • #5
          It's a linux box.

          I found one in usr/local/lib which contained the line:-
          memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)

          I changed it to:-
          memory_limit = 16M ; Maximum amount of memory a script may consume (16MB)
          But still get the error, do I need to reboot the box for the new settings to work?


          • #6
            Originally posted by Bat21 View Post
            do I need to reboot the box for the new settings to work?
            You need to restart Apache. E.g.

            # /etc/init.d/apache restart
            "The lurking suspicion that something could be simplified is the world's richest source of rewarding challenges"
            - Edsger Dijkstra


            • #7
              Nice one René, all works fine now


              • #8
                I hade the exact same problem and used the exact same
                php.ini edit solution. Gotta love that search function!

                Thanks for the help renep, Zachery & Bat21!


                • #9

                  Thought i'd hijack this thread for a similar question. Basically i'm wondering what you should set your php memory limit to. Some text searches my users try to perform run out of memory even when i have the limit set to 16MB.

                  I'm using 24MB now and the machine has 1GB in RAM and is barely swapping anything so far. What is a good limit for boards of about 49 290 threads and 835 558 posts? Is it possible for me to ask for opinions from other users with similar boards here? Would be great to get some feedback.


                  widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.