PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Fatal error: Call to undefined function: array_fill()

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fatal error: Call to undefined function: array_fill()

    I have installed Zoom and indexed my site, then uploaded the generated files to the server (which is running php4). However, on attempting a search via search.php I get the following error message:

    Fatal error: Call to undefined function: array_fill() in /home/httpd/vhosts/regulationshop.info/httpdocs/search.php on line 683

    Is this a limitation of the version of PHP on the web server, or is there some other cause?

    Would be grateful for some help with this

    TIA

    Cherry Mulliss

  • #2
    The array_fill function is only available in PHP V4.2 or greater. See the PHP documentation.
    http://au3.php.net/manual/en/function.array-fill.php
    So you are probably running an old version of PHP on your server.

    You can check your PHP version using the phpinfo command.

    e.g. make a new PHP page on your web site with just this code in it.
    <?php
    phpinfo();
    ?>

    -------
    David

    Comment


    • #3
      Fatal error: Call to undefined function: array_fill()

      Hi

      Thanks for that (feeling a bit silly, for some reason although I always use phpinfo() when I am installing php / mysql locally, I hadnt thought to use it to check my web hosts server <g>).

      Its running PHP 4.1.2, so that explains it. I will see if they can be persuaded to update it - last time I asked for something similar they said it wasnt possible, so may have to find a work around or move

      Again, thanks for the speedy reply!

      Regards

      Cherry Mulliss

      Comment


      • #4
        We'll fix this in the next build so that it will work with older versions of PHP4. It has been some time since we tested on such an old version of PHP (PHP 4.1 was released back in 2001).

        In the meantime, a quick fix would be to replace the following line in search.php:

        Code:
        $sw_results = array_fill&#40;0, $numwords, 0&#41;;
        with the following:

        Code:
        $sw_results = array&#40;&#41;;
        for &#40;$i = 0; $i < $numwords; $i++&#41;
            $sw_results&#91;$i&#93; = 0;
        Note that this will no longer be necessary in the next build (4.2.1002).
        --Ray
        Wrensoft Web Software
        Sydney, Australia
        Zoom Search Engine

        Comment

        Working...
        X