The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Entropy Search for PHP

Discussion in 'cPanel Developers' started by Sam Hobbs, Aug 20, 2004.

  1. Sam Hobbs

    Sam Hobbs Member

    Joined:
    Aug 20, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    California
    I am new; I am not sure if this is the correct place to ask about Entropy Search.

    I use a web site hosting service that had cpanel and Entropy Search. However Entropy Search does not work for PHP pages. Is there a configurartion that I (or they) need to change?
     
  2. Etheral

    Etheral Well-Known Member

    Joined:
    Dec 8, 2003
    Messages:
    208
    Likes Received:
    0
    Trophy Points:
    16
    hrmm , it should work just fine. if you've copied and pasted the form code it gives you, and placed it were you want it, and Not edited the receiving template it should work fine also, wat is the error you get when you try to use it?
     
  3. Sam Hobbs

    Sam Hobbs Member

    Joined:
    Aug 20, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    California
    I don't get an error; I just don't get results for pages with a php extension. Nearly all my pages have a php extension, so the search does not work for searching nearly my entire site. When I say "does not work" I mean that I don't get results; I don't get an error either. I know that the problem is the file extension, since I have a couple of pages with a HTML extension, and the search finds text from them.

    My site is Sam's Simple Samples. The search can find text from my Anti-Spam Tip but not text from any of the pages with a php extension.

    I did copy the form code as it was provided; the following is what I have:

    HTML:
    <form action="/cgi-sys/entropysearch.cgi" target=searchwindow>
    Search Query:&emsp;
    <input type="text" name="query" value="" size="20">
    <input type="hidden" name="user" value="simples">
    <input type="hidden" name="basehref" value="http://simplesamples.info">
    <input type="hidden" name="template" value="default">
    <input type="submit" value="Search">
    </form>
    That is the code provided by the host service. As I said, it works for the HTML pages.
     
  4. goodmove

    goodmove Well-Known Member

    Joined:
    May 12, 2003
    Messages:
    624
    Likes Received:
    0
    Trophy Points:
    16
    Tell your host to add the php extensions to the list of searchable files in

    /usr/local/cpanel/bin/makeindex

    Example:

    HTML:
    @EXTS=("php","php3","txt","html","shtml","htm");
    The file should be chattr +i to prevent the cpanel updates to replace it.
     
  5. Sam Hobbs

    Sam Hobbs Member

    Joined:
    Aug 20, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    California
    Thank you; I will do that very soon, or have the host company do it. Regardlous, that is probably the answer.
     
  6. aegis

    aegis Well-Known Member

    Joined:
    Jul 6, 2003
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    6
    Hopefully your host company will tell you that it's a bad idea. Entropysearch just dumps the raw text from the files it indexes minus the HTML tags. With a php file it will dump the source code including any passwords you might have in it.
     
  7. Sam Hobbs

    Sam Hobbs Member

    Joined:
    Aug 20, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    California
    Actually I have not heard anything from them. He usually is helpful and responsive but I have not heard from him about this.

    Thank you for explaining. It is unfortunate that Entropy Search processes php files in that manner. The search is still not working. In this situation, it would not be a problem if the entire php file is indexed, since I am actually using very little php. Since it would however be a problem if I were to add php code, entropy search is not useful. So I need to find a search that is useful with php files in a Linux/Apache environment.
     
  8. aegis

    aegis Well-Known Member

    Joined:
    Jul 6, 2003
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    6
    It could be made better to some extent by changing the makeindex perl script to strip out code inside php tags as well. I raised a ticket suggesting that change for cpanel - ticket 72430. Perhaps a perl hacker might want to change that - my perl isn't that hot.

    A better solution possibly would be htdig in the long run working with virtual hosts. You can install it as an rpm but you need to change the /etc/htdig.conf file manually.
     
  9. Sam Hobbs

    Sam Hobbs Member

    Joined:
    Aug 20, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    California
    Ignoring the php code would help in many situations but php code often generates portions of the HTML. In those situations, ignoring the php code can be a problem, correct? If so, then I can understand why it would not be a good general solution.
     
  10. aegis

    aegis Well-Known Member

    Joined:
    Jul 6, 2003
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    6
    Yes, that would be the problem with it. Any php that used echo, print otherwise generated the html wouldn't get indexed, but, if you're just using it as a server side scripting language to insert little snippets of code in an otherwise normal html page it should do ok.

    If you're using almost entirely php then more than likely you've got a database there too and search would be best done from the database.
     
Loading...
Similar Threads - Entropy Search PHP
  1. Renata Dias
    Replies:
    1
    Views:
    215

Share This Page