cannot run program from apache, perl, win xp pro

cannot run program from apache, perl, win xp pro

Post by whynot11 » Fri, 09 Jan 2004 12:55:09

I am trying to run a command from a web page using perl. The server
is Win XP pro and Apache. I can run the command fine from the
command line, but it is not making it from perl. Is this a
permissions issue? (how could I enable it)

$command = "c:\\Progra~1\\HomeCo~1\\x10com32.exe";
@args = ($command, "a4", "off");

I can type
c:\Progra~1\HomeCo~1\x10com32.exe a4 off
at the command line and it works fine, trying to get this command from
a web page.

I am getting through to windows cause this will work:
system("dir c:\\Progra~1\\HomeCo~1\\x10com32.exe");

permissions apache has to execute programs? What can be done to
enable the execution of program. Tried putting program in local www
dir as well.

cannot run program from apache, perl, win xp pro

Post by shb*NO*SPA » Fri, 09 Jan 2004 15:14:16

On 7 Jan 2004 19:55:09 -0800, XXXX@XXXXX.COM (CoralBanded)

You can do some simple test to see if the cgi function is
running. Copy/paste each of the below and save in the cgi-bin
folder. Then use in your brouser to
see if the ringin.wav file plays, and
in your brouser to see if the page displays. If the below work,
then it is probably something to do with perl execution.


@Echo OFF
Echo Content-type: text/html
Echo ^<HTML^>
Echo ^<HEAD^>
Echo ^<TITLE^>Script Command start-zoom^</title^>
Echo ^</head^>
Echo ^<BODY^>
Echo ^<H1^>Batch File CGI Test^</h1^>
Echo Initiating command now:
Echo /////////////////////
echo ^<P^>Your IP address: %REMOTE_ADDR%^<BR^>
echo Your browser: %HTTP_USER_AGENT%^<BR^>
echo You visited before: %HTTP_REFERER%^<BR^>
echo You accept the languages: %HTTP_ACCEPT_LANGUAGE%^</P^>
echo the query_string is: %QUERY_STRING%^</P^>
Echo /////////////////////
Echo Report any failures to:
Echo ^<A Href="mailto: XXXX@XXXXX.COM "^> XXXX@XXXXX.COM ^</a^>.
Echo ^</body^>
Echo ^</html^>


@echo off
echo status: 204
sndrec32.exe /play /close %windir%\media\ringin.wav


cannot run program from apache, perl, win xp pro

Post by whynot11 » Sat, 10 Jan 2004 11:07:52

hanks for the things to try, those will run, tried this bat file as
@echo off
echo hello
x10com32.exe a4 off
echo hello

get the 2 hellos but the program does not run. I can kick off the
batch file on the command prompt and it runs fine. I put the program
in the windows/system32 dir and verified it can be run from any
directory (from command prompt). I can kick off any of the bat files
from URL so PERL is not involved in this issue.

I also tried running the ringin.bat batch file from another computer
(no browser, just double click the bat file through explorer). The
ringin.bat and test.bat work.

All of the scripts show this in the top of the command window:
CMD.EXE was started with above path as current directory.
UNC paths are not supported. Defaulting to Windows directory.

When I try and run the script above with x10com32.exe I get the
following in addition to the UNC paths message above:
'x10com32.exe' is not recognized as an internal or external command,
operable program or batch file.

Something with security access to this program (based on who is
running it, coming from apache or another computer and it will not

shb*NO*SPAM* (Si Ballenger) wrote in message news:< XXXX@XXXXX.COM >...