Jump to content

Accessing cgi-bin folder with file_exists


SWD

Recommended Posts

HI All,

I've got a sneaking suspicion my problem is either impossible to solve or so simple I'll be embarrassed by the solution.  Our web server, like most, has the cgi-bin folder sitting below the document root.  You can however access cgi scripts using /cgi-bin/<script name> on the browser address line.

 

My problem is that I need to get the full path to a cgi script so it can be run using exec.  At present when the call is made to file_exists I get file not found.  When I log into FTP I can see that the file exists.

 

Does anyone know how to get round this problem?

 

To clarify further.... my cgi script is physically located at

'/var/www/vhosts/myserver.com/cgi-bin/test.cgi'.  To access on the command like I go http://www.myserver.com/cgi-bin/test.cgi and that works fine.  If I look at $_SERVER [ DOCUMENT_ROOT ] it returns /var/www/vhosts/myserver.com/httpdocs/.

 

It's almost as though you cannot physically access the cgi-bin folder with a full path.

 

Any help would be hugely appreciated.

 

Thanks

 

Lost Programmer

 

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.