#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    2
    Rep Power
    0
    Hi folks,
    I'm desperately trying to get an external program (i.e. Notepad for test use) running.
    I'm using PHP3 and Apache under WinNT.
    Everything I tried failed:

    system ("notepad.exe");
    or
    exec ("notepad.exe");
    or
    popen("notepad.exe", "w");
    or
    echo `notepad.exe`;

    Each time a new process "NOTEPAD.EXE" has been created, but it's only visible within the task-manager without the possibility to kill it.
    The PHP-script seems to be still active for a long, long time.

    Any helpful ideas are very welcome. Thanx.
  2. #2
  3. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    61
    Well, you're trying to run a windows program from a language that wasn't intended for the desktop. I'm not sure exactly what the problem is, but it's probably something about running in a non-console mode that can't open a new window.

    The question is "Why try executing a windows program from a webserver?" Try executing a command-line program, or, better yet, create a small batch file that does something file-based, like write some text into a file or something. Or for example starting or stopping a WinNT service: "net stop Spooler" or "net start Spooler".
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    2
    Rep Power
    0
    Hi rycamor,
    thanx a lot for your ideas. The problem I had(!) was much more complex as just starting notepad.
    The thing I'm doing is to invoke via PHP a CORBA-Client on the webserver which is accessing the appropriate CORBA-Server somewhere within the network.
    The problems were:
    (1) My webserver (Apache) was running with wrong permissions
    (2) The client forgot all environment variables when it was invoked by PHP/Apache

    #2 is really a silly thing. I set up a few variables in the client-code and yeahhh, it works!

Similar Threads

  1. Replies: 2
    Last Post: August 18th, 2004, 10:45 PM
  2. Executing a program as ROOT with php.
    By shadovv in forum PHP Development
    Replies: 6
    Last Post: April 12th, 2004, 07:44 PM
  3. executing external programs with apache
    By Tantalus in forum Apache Development
    Replies: 1
    Last Post: January 28th, 2004, 06:44 PM
  4. Executing PHP script using crontab with PHP module
    By crazyIvan in forum PHP Development
    Replies: 0
    Last Post: January 23rd, 2004, 08:27 AM
  5. UnixODBC + PHP + Apache + Empress
    By coder4hire in forum Database Management
    Replies: 0
    Last Post: January 15th, 2004, 01:41 PM

IMN logo majestic logo threadwatch logo seochat tools logo