SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    Almeaty Member
    Join Date
    Jul 2000
    Location
    Nowhere
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question about virtual()

    Hi,

    I have a problem with the function virtual() with which I want to parse in a file that is in a directory-level above. I keep gettings errors that PHP was unable to include the path ../cgi-bin/path/to/script.cgi

    /cgi-bin/... works though. Any ideas how to make it possible? Thx!

  2. #2
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    From http://www.php.net/manual/en/function.virtual.php

    Note that for a CGI script, the script must generate valid CGI headers. At the minimum that means it must generate a Content-type header. For PHP files, you need to use include() or require(); virtual() cannot be used to include a document which is itself a PHP file.
    May help...may not. Just thought it might help to check the CGI file to see if all is cool on that end.

  3. #3
    Almeaty Member
    Join Date
    Jul 2000
    Location
    Nowhere
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yea the CGI file works fine... the problem is how to execute a script that is in a directory above? It's not described in the php website

  4. #4
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that may be how it's supposed to be. e.g. it only works starting from the site root (/cgi-bin/.....) and not with "../"'s in the path. that might be how the "include virtual", or whatever it is, SSI tag works, so this would be the same as that i would think. dunno, just a thought.
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  5. #5
    Almeaty Member
    Join Date
    Jul 2000
    Location
    Nowhere
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hm, it's still the same. I even tried with /../cgi-bin/

    Probably I need to copy the entire directory so virtual() can successfully execute. Do you have a more elegant solution? Thx

  6. #6
    Almeaty Member
    Join Date
    Jul 2000
    Location
    Nowhere
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh dude, it actually works fine with /cgi-bin/...
    Even subdirectories recognise it. But the problem occurs again when I use subdomains. Is there a solution for this? Thx

  7. #7
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am 99% sure your host has /cgi-bin as an alias to your cgi-bin even if it lives a dir below the web root. Thats why you can use /cgi-bin ta access scripts in a folder below the current one. Make sure your subdomains /cgi-bin alias points to the proper place.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •