All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

open_basedir error in Low Search

Bryan 29 Jul 2014 13:13 question, complete

I just installed Low Search. An empty template except for the example search form gives the error:

A PHP Error was encountered
Severity: Warning
Message: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/nfs/ ... /expressionengine/third_party/index.html/filters/) is not within the allowed path(s): (... /apache2/gs-bin)
Filename: libraries/Low_search_filters.php
Line Number: 236

I deleted some of the path info. I'm using EE 2.8.1.

Am I missing something basic?

Replies

  1. Low 29 Jul 2014 13:15

    Can you try and apply the fix mentioned here?
    https://getsatisfaction.com/low/topic...

  2. Bryan 30 Jul 2014 01:07

    Thanks. That fixed that issue. But now a search will not show any results. Could it be related? I have a very simple (testing) template.

    {exp:low_search:form result_page="imagebank/results" channel="image_bank" collection="image_bank" }
    Keywords

    Search
    {/exp:low_search:form}

    and

    {exp:low_search:results query="{segment_3}" limit="10"}
    {if count == 1}

      {/if}
    1. {title}

    2. {if count == total_results}
    {/if}
    {if no_results}No search results{/if}
    {/exp:low_search:results}

    I have created a collection and given weight to a few fields. When I search for any text I know is in the entries, I get no results. I have looked around the forum and on Stackexchange and do not see any similar issue except for post where the query was pointing to the wrong segment. I don't think I have that wrong.
    Am I missing a step or something? Thanks.

  3. Low 30 Jul 2014 08:13

    OK, where you made the first change in the Low_search_filters.php file, try and change the entire content of the foreach loop (that starts at line #229) to this:

    // The paths we're looking for
    $path = PATH_THIRD.$item;
    $dir = $path."/{$this->_filters_dir}/";

    // Skip if we're not dealing with dirs
    if (@is_dir($path) && @is_dir($dir))
    {
    $dirs[] = $dir;
    }
    That should work, even with the open_basedir restriction.

    As for not getting results: you have 2 filter parameters set on the Form tag (channel and collection). These should be set either to the Results tag, or added as hidden input fields inside the form. The way they are now, they have no effect.

    Can you try and share your code again? GetSat strips away stuff. You can use http://pastie.org/ or http://pastebin.com/ for large chunks of code.

    Also, enable template debugging and copy/paste all lines mentioning Low Search here.

  4. Bryan 31 Jul 2014 02:15

    I made the change to the code and I get this:

    Severity: Notice
    Message: Undefined variable: item
    Filename: libraries/Low_search_filters.php
    Line Number: 231

    and a blank page.

    I reverted back to the code edit from the other post and the search form displays but still shows no results. I tried to make the code as simple as possible:

    http://pastebin.com/J0b7QXkB

    The template debug output is at https://dl.dropboxusercontent.com/u/3...

    The result form is at http://pastebin.com/VyGMDLJS and the template output is at https://dl.dropboxusercontent.com/u/3...

    Thanks for your help.

  5. Low 31 Jul 2014 06:50

    You probably replace the entire loop, instead of just the inside of it. The loop opens on line 229, then there's an opening { below it. Everything that is contained with those {} should be replaced with the code I shared earlier. I can also do it for you, but then I'd need FTP access.

    As for the no_results, I can see LS is returning entries, ie. these IDs: 509|508|510|512|513|507|503|499|500|501|502|498

    They could be negated by other entry properties, like status, or their entry date is in the future, or they're expired. So try and verify if that is the case with those entries.

  6. Bryan 1 Aug 2014 00:26

    Thanks for your help. I got it working. Both were dumb mistakes on my part.