开发者

php system() function calling cgi on IIS7 vs Apache

On Apache the code below will run index.cgi and return the content of cgi to php page

    <?php
    $command= './cgi-bin/index.cgi';
    echo system($command);
    ?>

On IIS this doesn开发者_如何学Go't seem to work that way. How can I have the same behavior on IIS 7 ?


Short answer: You can't.

This is why: The command ./cgi-bin/index.cgi does either not exists on IIS or is not executable on the IIS platform. This is a command that is dependent to the computer system the PHP script is installed on.

On IIS you need to create code that is cross-platform compatible. It needs to choose another command that does the same like ./cgi-bin/index.cgi but actually works on the IIS platform.

Probably not the answer you would like to hear. Probably you can say what that CGI script does and we can find a solution. Alternatively you can add the code from that file to your question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜