mattscotne
Programmer
Hi all,
My web host has php setup as a cgi and I need to use the virtual function to run a cgi script:
However because php has been setup as a cgi as apposed to an Apache module I can not use the virtual() function. The web host will not change the php install to an Apache module.
I have done lots of google research and found a number of commands that replicate what I am trying to do including:
passthru:
system:
exec:
shell_exec:
All of the above ouput the "Content-type: text/html" and the javascript cookie set by the script.cgi to the browser.
The script.cgi should be recording the referer but it is not functioning correctly, it does not even record a page hit as a noreferer.
I know that there is nothing wrong with the script.cgi as it is a commercial application and it records the referer correctly when I use a .shtml page( <!--#include file="script.cgi"-->) instead of a .php page.
I think what is happening is that Apache's environment variables such as HTTP_REFERER are not being passed on to the subprocess environment correctly.
How can I get this to work? or in other words what can I do to replicate the virtual() function?
My web host has php setup as a cgi and I need to use the virtual function to run a cgi script:
Code:
virtual('full/server/path/to/script.cgi');
However because php has been setup as a cgi as apposed to an Apache module I can not use the virtual() function. The web host will not change the php install to an Apache module.
I have done lots of google research and found a number of commands that replicate what I am trying to do including:
passthru:
Code:
passthru('full/server/path/to/script.cgi');
system:
Code:
echo system('full/server/path/to/script.cgi');
exec:
Code:
echo exec('full/server/path/to/script.cgi');
shell_exec:
Code:
echo shell_exec('full/server/path/to/script.cgi');
All of the above ouput the "Content-type: text/html" and the javascript cookie set by the script.cgi to the browser.
The script.cgi should be recording the referer but it is not functioning correctly, it does not even record a page hit as a noreferer.
I know that there is nothing wrong with the script.cgi as it is a commercial application and it records the referer correctly when I use a .shtml page( <!--#include file="script.cgi"-->) instead of a .php page.
I think what is happening is that Apache's environment variables such as HTTP_REFERER are not being passed on to the subprocess environment correctly.
How can I get this to work? or in other words what can I do to replicate the virtual() function?