aktivere ekstern program fra web-side

Author Message

Knut Arne Aaltvedt

Tuesday 13 October 2009 6:34:21 am

Jeg kjører Apache på en Window XP maskin og PHP 5.2.10.

Fra programmet vil jeg aktivere et program i bakgrunn.

Jeg forsøker med en kommandolinje som ser slik ut (C:\programfiler\mittprog.exe /Ubrukernavn /Ppassord /c /RC:\tekst.txt). Når jeg kjører denne i cmd (kjør) så fungerer det. Så har jeg forsøkt å kjøre følgende php kode.

$kode = "C:\\programfiler\\mittprog.exe /Ubrukernavn /Ppassord /c /RC:\\tekst.txt";
$WShell = new COM("WScript.Shell");
$exe = $WShell->Run($kode, 7, false);

Har også forsøkt:

exec($kode);

Hva må jeg gjøre for at dette skal fungere?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 00:38:25
Script start
Timing: Jan 31 2025 00:38:25
Module start 'layout'
Timing: Jan 31 2025 00:38:25
Module start 'content'
Timing: Jan 31 2025 00:38:25
Module end 'content'
Timing: Jan 31 2025 00:38:25
Script end

Main resources:

Total runtime0.0211 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 588.2344151.2109
Module start 'layout' 0.00550.0036 739.4453220.6875
Module start 'content' 0.00910.0106 960.1328993.7266
Module end 'content' 0.01970.0014 1,953.859429.9922
Script end 0.0211  1,983.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002411.4201140.0002
Check MTime0.00104.9321140.0001
Mysql Total
Database connection0.00094.262510.0009
Mysqli_queries0.002612.337030.0009
Looping result0.00000.084710.0000
Template Total0.00104.810.0010
Template load0.00083.604210.0008
Template processing0.00031.193510.0003
Override
Cache load0.00052.401710.0005
General
dbfile0.00021.156280.0000
String conversion0.00000.033940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs