Professional Web Applications Themes

exec disabled, so how to call C++ .exe file? - PHP Development

Not sure if this is the right group for this but here goes anyway. 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 ...

  1. #1

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

    Not sure if this is the right group for this but here goes anyway.

    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







    Greg Guest

  2. #2

    Default Re: exec disabled, so how to call C++ .exe file?

    In article <news.uk.clara.net>,
    "Greg Chapman" <com> wrote:
     

    With your current ISP's configuration, you are not able to call external
    programs like Sudoku.exe from a php program. Their configuration won't
    allow it. If they're unwilling to change their configuration to offer
    you shell_exec, exec, system, passthru, or popen functions, you have two
    options:

    (1) write a perl script which calls system('Sudoku.exe').

    (2) find another ISP that offers services that better suit your needs
    (you may end up getting a dedicated Linux system that you'll have to
    configure and administer yourself)

    If you can't code in perl or it turns out they've disabled the system()
    function in perl, you really only have option (2) available to you.
    Good luck.

    --
    DeeDee, don't press that button! DeeDee! NO! Dee...



    Michael Guest

  3. #3

    Default Re: exec disabled, so how to call C++ .exe file?

    Thanks Michael
    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
     


    Greg Guest

Similar Threads

  1. #39513 [NEW]: URL file-access is disabled when allow_url_fopen = On
    By scott at html dot info in forum PHP Bugs
    Replies: 2
    Last Post: November 14th, 06:49 PM
  2. Evalulating if an exec() call has worked?
    By Bonge Boo! in forum PHP Development
    Replies: 4
    Last Post: May 8th, 06:45 PM
  3. How to redirect stdout to a file with fork-exec?
    By music4 in forum UNIX Programming
    Replies: 2
    Last Post: September 24th, 08:02 PM
  4. executing multiple shell commands via one exec()-call
    By Falk Schneider in forum PHP Development
    Replies: 1
    Last Post: July 15th, 06:20 AM
  5. Replies: 0
    Last Post: December 10th, 09:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139