I have an application that I want run SERVERSIDE through my PHP script, and I've used the exec() command, no biggie.

The problem is, the application starts as a PROCESS, and I want to to actually EXECUTE on the desktop, SERVERSIDE. (i.e. POP UP in front of me everytime someone executes the script)

I've read through the PHP Manual and the threads that follow, but I haven't been able to get anything out of it.. could someone PLEASE help me.

On a Further note, I'd just like to clear up some simple questions that are bound to pop up.

I'm running an Apache2 webserver with PHP 4.x, on a Win2000 machine.

The Application is in my "Home Directory" ( c:\ ), and it accepts 3 Command Line Arguments (-x -y and -msg)

It CAN and HAS BEEN exectued through the command prompt (cmd.exe) and runs just like it's supposed to.

I'm trying to run this SERVERSIDE.. not CLIENTSIDE

Thank you.

    Try something like this:

    exec("start yourprogram.exe -arguments");

    Diego

      That got me SOMEWHERE, after I added the start at the beginning, something definately changed. The application still doesnt pop up, but windows plays an "error" sound (the annoying Ding) .. and ideas or suggestions as to what may be going on and how to fix it?

        you may also try using the ancient bat file. That should cause dos window to pop up.

          I've worked around my issue by simply writing an app that accepts a socket connection and pops up upon connection, but i want to keep working around the issue at hand.

          Is there a way to make the program run on the FOREGROUND, rather than a BACKGROUND Process.

            a month later

            I was searching throught the forum and found this thread. I noticed it died and was wondering if you ever found a solution. I currently have the EXACT same problem you do and I haven't had any luck fixing it. Just curious if you did.
            SHANE

              Sorry Shane, but I never got to fixing my problem via PHP. I did eventually find my way around it, as my last post states, but I guess that wouldn't be much help unless you're familiar in application based programming such as C++ or at Visual or Real Basic.

              The Application basically runs as a server on my system, hidden in the background just constantly listening if anyone submits the form, and once someone does, it does its thing.

              If you have no luck with PHP, feel free to email me

              'sirblack@canada.com'

              and I would be glad to help you write an application to accomplish your goal.

                i also have the same problem.

                i tried a script on my computer(windowsxp,apache2), and nothing happens, only show as a process.

                i also tried on a computer friends and it works perfectly but is windows98se.

                i think the problem is on the windows(hope not)

                  If it works on Win98, but does not on 2000/XP, then it is most likely to be a permissions issue. Windows is probably denying access to the screen because of the user apache is running as.

                    What user should apache run as then? Any suggestions?

                      hehehe, i've got a beautiful solution for those who want to know when someone executes a script...

                      there's this wonderfully simple program, beep (http://members.optushome.com.au/quentinc/beep.html) that beeps whenever you run the program....

                      then you add this line to the beginning of your script:

                      system("BEEP.EXE /F3000 /L50");

                      make it sound one way when someone executes the script and then different when, for example, an error occurs.....

                      man, am i a genius or what... is this super or what...

                      ozzythaman

                        A beep is one thing, but having the actual window pop up is a completely different story.

                        I've tried both the exec() and system() functions and I can't get an actual PHYSICAL GUI window to pop up.

                        I salute your attemp; but so far we haven't made any progress yet.

                          a month later

                          mmm.
                          ive got a similar problem.
                          my exe shoves up a windows message box when run from cmd, but not when run from exec()
                          its annoying because i cant actually get the exe to run because its waiting for the ok box to be hit.

                          how the hey do i do that? i dunno how to pass a CR to the functn after a few seconds....

                            one thing all of you guys might consider, if you are good at OOP in VB and/or C++(6 or .NET) you might want to write a com object and load it on your server(a whole lot more effencient) and just have your php script make a com request to your app, presto

                              ok friends, this works:

                              create a php file that executes a program with exec or system.
                              put the file somewhere in your server.

                              do fsockopen to your server, puts this:

                              GET /filename.php?param=abc

                              then read (neccessary?) 1 byte or something

                              close the connection..

                              the program will then be executed...

                              not perhaps the most efficient way but it DOES work... and perhaps a method not many people are aware of...

                                ok guys, check this out:

                                exec("useradd mumu");
                                exec("smbpasswd -a mumu secret");

                                this 2 lines will never execute normaly in a php file. the reason is simple: you need root access for useradd and smbpasswd commands. still, i need a way to trick this. the above lines were given as examples, i need this to automate some things that i do with openssl command. can anyone please help?

                                thank you.

                                ps: it requires recompiling?

                                  Write a Reply...