tworking Posted September 28, 2007 Share Posted September 28, 2007 Hi all, On my server python has to run in the wwwroot/cgi-bin folder, but php can run anywhere. My site is going to be written in python but I don’t want my user to see the url as mysite/cgi-bin/... . So for example my homepage, index.php should contain a simple php script that will get my python page from the cgi-bin directory and display it. However when I try to use SSI or fopen/file_get_contents/readlink and commands like these it just displays the python code. Where as when I visit the python page in my browser it runs it and displays the output for me. My question is what php function can I use to execute my python page and return the output, not the code itself. (I think my hosting provider has disallowed certain powerful commands like system() etc. Does this make it impossible?). As the very least can’t my php script pretend to be a www user and ‘visit’ the python page to read the output? Many thanks. Quote Link to comment https://forums.phpfreaks.com/topic/71043-solved-php-function-to-read-local-python-script-output-not-code/ Share on other sites More sharing options...
cooldude832 Posted September 28, 2007 Share Posted September 28, 2007 why not just use .htacess mods to rewrite it so no one can really know whats happening Quote Link to comment https://forums.phpfreaks.com/topic/71043-solved-php-function-to-read-local-python-script-output-not-code/#findComment-357190 Share on other sites More sharing options...
tworking Posted September 28, 2007 Author Share Posted September 28, 2007 why not just use .htacess mods to rewrite it so no one can really know whats happening That did cross my mind, but I wan't sure if it was possible on a shared server. But a .htaccess file is of course placed in the directory concerned so I guess that would indeed be the best way of doing it. Thanks for pointing it out! Quote Link to comment https://forums.phpfreaks.com/topic/71043-solved-php-function-to-read-local-python-script-output-not-code/#findComment-357207 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.