Connecting Tech Pros Worldwide Help | Site Map

exec, passthru disabled so how to call C++ .exe file?

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 01:29 PM
Greg Chapman
Guest
 
Posts: n/a
Default exec, passthru disabled so how to call C++ .exe file?

I am at my wit's end trying to get information out of Streamline.net's
support dept about my problem. They reply quickly enough, but seem to try
and give out the least possible amount of info each time. The transcript so
far is reproduced for your amusement below.

To summarise:

I've put up a Sudoku-solving program called Sudoku.exe. I want to call it in
a php script to solve a puzzle and output the solution. It works fine with
Apache/php on my own machine, but it seems Streamline.net disable exec,
passthru etc. They eventually say, cryptically: ' CGI executables are
supported, however this is very different from executing a program from
within a PHP script'. So how would I call my Sudoko.exe file?

Any help appreciated

Greg Chapman



The 'dialog':

My last question seems to have been 'fixed' before being answered, so I'll
have another go.
I'm trying to call an .exe file on the server but get an 'unable to fork'
error message. I have Apache/php installed locally and it works fine. Do you
have to turn on 'cmd.exe' permissions or something? Try it yourself at:
http://www.ramseyarts.co.uk/sudoku.shtml

Warning: passthru(): Unable to fork [Sudoku.exe (argument...)] in (.php
file...)
It's the same with exec() as well.
Regards
Greg Chapman


Hi Greg,

Thanks for your query.

We do not support passthru or exec functions.

Kind Regards,
StreamlineNet
Streamline.Net - The home of good value web hosting



So how would I call my Sudoku.exe program from a php script?


Hi Greg,

Thanks for your query.

Unfortunately we do not provide scripting help, we suggest searching on
google for scripting help sites.


Kind Regards,
StreamlineNet
Streamline.Net - The home of good value web hosting


I do not want 'scripting help', I just want to use some of the functions
that you offer as a host and which I have paid for.
As I have said what I am trying to do works perfectly on my machine, so it
must be a question of something you have to enable your end. What do you
mean you don't support passthru or exec? They are both standard php
commands.
Please read my questions properly and do me the courtesy of giving a proper,
non-automatic reply.

Greg Chapman


Hi Greg,

Thanks for your query.

You asked "how would I call my Sudoku.exe program from a php script?"
clearly this is asking us how you can use scripting?

Certain functions are disabled in PHP for security reasons.

Kind Regards,
StreamlineNet
Streamline.Net - The home of good value web hosting


Which functions are 'disabled in PHP for security reasons' ?


Hi Greg,

Thanks for your query.

You can find this out with the inbuilt php function phpinfo()

Kind Regards,
StreamlineNet
Streamline.Net - The home of good value web hosting


Could you tell me where on the page that phpinfo() produces these functions
are listed? For example, passthru() does not appear to be on the page.

Hi Greg,

Thanks for your query.

search for "disable_functions" on that page.

Kind Regards,
StreamlineNet
Streamline.Net - The home of good value web hosting



disable_functions lists 'no value'. So again, could you tell me where I can
find the list of standard php functions which you have disabled?

Hi Greg,

Thanks for your query.

Please can you provide a link to your phpinfo file so we can investigate
this further.

Kind Regards,
StreamlineNet
Streamline.Net - The home of good value web hosting


The link is:
http://www.ramseyarts.co.uk/info.php

Thanks for your query.

We had previously checked this on a linux server, which showed the functions
that have been disabled. We've passed this on to an engineer to investigate
further.

For your information the following are disabled:

shell_exec,exec,system,passthru,popen

Kind Regards,
StreamlineNet
Streamline.Net - The home of good value web hosting



Your knowledge base says:
Q. Are CGI (Common Gateway Interface) executables supported?

A. Yes these are supported on either the Windows and Linux servers

But you are telling me that the only php functions which can call my
executable are disabled. Will you clarify once and for all if I can call my
exe file or not. I AM NOT ASKING FOR SCRIPTING HELP, I have books about
that. I just want to know if I can do ON YOUR SERVER what you say I can do,
and if not why not.



Hi Greg,

Thanks for your query.

CGI executables are supported, however this is very different from executing
a program from within a PHP script.

Kind Regards,
StreamlineNet
Streamline.Net - The home of good value web hosting








  #2  
Old July 17th, 2005, 01:29 PM
Gordon Burditt
Guest
 
Posts: n/a
Default Re: exec, passthru disabled so how to call C++ .exe file?

>I am at my wit's end trying to get information out of Streamline.net's[color=blue]
>support dept about my problem. They reply quickly enough, but seem to try
>and give out the least possible amount of info each time. The transcript so
>far is reproduced for your amusement below.[/color]

It's quite apparent that, as a matter of policy, they don't allow
execution of .exe files from PHP, and if you find a way to do it,
they'll likely do their best to close it, and/or close your account.

As to why this is more dangerous than allowing execution of a CGI
executable, I don't know, and if you convince them the distinction
is stupid, they'll disallow execution of CGI executables.

Think about making the executable a CGI, and invoking it from PHP
with fopen() of a "remote" URL that refers to the host you're on.
(Chances are this is turned off also.)

Gordon L. Burditt
  #3  
Old July 17th, 2005, 01:29 PM
Greg Chapman
Guest
 
Posts: n/a
Default Re: exec, passthru disabled so how to call C++ .exe file?

Thanks Gordon
Part of the problem was I got into php before doing any basic cgi stuff.
I wish support at Streamline were half as helpful.
I'm now calling my program outside of php and it works fine:
http://www.ramseyarts.co.uk/sudoku.shtml

(Actually it's a crap program and only works on easy puzzles...)
Greg Chapman


"Gordon Burditt" <gordonb.c1dg2@burditt.org> wrote in message
news:11a6cqctdqnhof6@corp.supernews.com...[color=blue][color=green]
> >I am at my wit's end trying to get information out of Streamline.net's
>>support dept about my problem. They reply quickly enough, but seem to try
>>and give out the least possible amount of info each time. The transcript
>>so
>>far is reproduced for your amusement below.[/color]
>
> It's quite apparent that, as a matter of policy, they don't allow
> execution of .exe files from PHP, and if you find a way to do it,
> they'll likely do their best to close it, and/or close your account.
>
> As to why this is more dangerous than allowing execution of a CGI
> executable, I don't know, and if you convince them the distinction
> is stupid, they'll disallow execution of CGI executables.
>
> Think about making the executable a CGI, and invoking it from PHP
> with fopen() of a "remote" URL that refers to the host you're on.
> (Chances are this is turned off also.)
>
> Gordon L. Burditt[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.