Home » Forum
  • If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

PHP Search Template - search.cgi Location

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

  • PHP Search Template - search.cgi Location

    Hi I have a question hopefully someone knows. I needed to make my own search page because I needed to use PHP. I was successful after reading the topic about this in other threads. But I am trying to do something else and now I am running into a problem. I'll have to explain my setup first:

    I have a web server with windows server 2008 rt and IIS7(this is where our domain name is linked to). I have another location on my network where I store all my data. I have virtual directories on IIS7 that link to the data(and search page)(The reason I do this is because I ran out of space on my web server). This is where I run into a problem and I am pretty sure it has to do with this line of php code:

    $output = shell_exec("C:\\Inetpub\\wwwroot\\zoom\\search.cgi ");

    Since the search page and the search.cgi is on another location than the web server(but the search page and search.cgi are in the same location on the 2nd computer), I am trying to figure out what the address should be. I was doing something like this:

    $output = shell_exec("C:\Inetpub\wwwroot\OH\search\search.cg i");

    This didn't work so I tried this thinking maybe it has something to do with IIS7:

    $output = shell_exec("\\server02\wwwroot\OH\search\search.cg i"); (This would be the network location from the web server)

    My guess is the address is wrong since I was able to get it work when the search page and search.cgi was on the actual server01 and not in another location(server02). If someone knows the correct path basing it off the address above that would be so helpful. Or is this not even possible.

    -Thanks

  • #2
    It should be possible, but this is all about getting your Windows sharing permissions right.

    For server01 to be able to execute the file "\\server02\wwwroot\OH\search\search.cgi", you would need to make sure that server02 has shared that file (and has granted read and execute access to the folders "wwwroot/OH/search" and "search.cgi").

    This means that from server01, you would be able to open an Explorer window and browse to \\server02\wwwroot\OH\search and execute and read the file "search.cgi".

    But that's not enough! That would just be for your current logged in user. Since you need IIS to be able to access it, you would need those permissions setup for the IUSR_MACHINENAME user account (or whatever is configured to be the user that IIS runs under).

    Naturally, if this is all too complicated for you, you could bypass all this by hosting the CGI on the same machine. Otherwise, the above would be necessary.

    Originally posted by sdweim85 View Post
    $output = shell_exec("\\server02\wwwroot\OH\search\search.cg i"); (This would be the network location from the web server)
    This would be correct if the above permissions etc. are setup right. The other shell_exec attempts you mentioned are incorrect (they are all local paths, so they're referencing files on server01).
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment


    • #3
      Ray,

      Thank you for your response.

      I went back and looked at the permissions and they all look correct. But I was not able to get it work. I'm sure I could be missing something. I did find a work around to which you suggested. I kept the pages and data on the server02 but moved the search.cgi and other zoom created files to server01 and basically linked my website to my search page on the other server. To anyone who has a similar situation, maybe this can help. I want to try and get it work the way I originally planned, but right now I do not have the time.

      Anyway, thank you for your assistance.

      Comment

      Working...
      X