CMD in php ausführen ????

Alles, was PHP betrifft, kann hier besprochen werden.

CMD in php ausführen ????

Postby Metty_D » 26. August 2005 11:36

Hi zusammen ...
ich stehe im Moment auf dem Schlauch und vielleicht kann mir hier jemand den richtigen Schubs geben damit ich von der Leitung runter gehe.

Ich habe einen aufruf im phpScript:

Code: Select all
....
$retVal = `checkConfig.cmd`;       // <--- Das ist in Backticks eingeschlossen.
.....

der Inhalt der checkConfig sieht folgendermassen aus:

Code: Select all
pushd "D:\Program Files\Apache Group\Apache2\bin\"
apache -n Apache2 -t 2>c:\logs\apacheSyntax.txt


Jetzt kommt folgendes Phänomän:

Wenn ich die checkConfig.cmd mit einem Doppelklick im Explorer aufrufe, gibt es folgende Meldung in apacheSyntax.txt welche auch richtig ist:
Code: Select all
Syntax OK


Wenn ich das php-Script aus führe, steht im apacheSyntax.txt folgendes:
Code: Select all
Usage: apache [-D name] [-d directory] [-f file]
              [-C "directive"] [-c "directive"]
              [-w] [-k start|restart|stop|shutdown]
              [-k install|config|uninstall] [-n service_name]
              [-v] [-V] [-h] [-l] [-L] [-t] [-S]
Options:
  -D name           : define a name for use in <IfDefine name> directives
  -d directory      : specify an alternate initial ServerRoot
  -f file           : specify an alternate ServerConfigFile
  -C "directive"    : process directive before reading config files
  -c "directive"    : process directive after reading config files
  -n name           : set service name and use its ServerConfigFile
  -k start          : tell Apache to start
  -k restart        : tell running Apache to do a graceful restart
  -k stop|shutdown  : tell running Apache to shutdown
  -k install        : install an Apache service
  -k config         : change startup Options of an Apache service
  -k uninstall      : uninstall an Apache service
  -w                : hold open the console window on error
  -e level          : show startup errors of level (see LogLevel)
  -E file           : log startup errors to file
  -v                : show version number
  -V                : show compile settings
  -h                : list available command line options (this page)
  -l                : list compiled in modules
  -L                : list available configuration directives
  -t -D DUMP_VHOSTS : show parsed settings (currently only vhost settings)
  -S                : a synonym for -t -D DUMP_VHOSTS
  -t                : run syntax check for config files
apache: illegal option -- n



man beachte die letzte Zeile !!!!!
Warum zum Geier ist die Option n nicht gültig ?????

Kann mir jemand helfen ?
ich habe mit absicht die simpelste Version gepostet, da ich mich schon zu Tode gequotet habe und es alles nix gebracht hat.

LG Metty
User avatar
Metty_D
 
Posts: 6
Joined: 24. August 2005 15:56

Postby Metty_D » 26. August 2005 14:51

Hat keiner nen Input für mich ?
Ist echt dringend *fleh*
User avatar
Metty_D
 
Posts: 6
Joined: 24. August 2005 15:56

Postby adi99 » 26. August 2005 18:57

Bin zwar kein Experte,
aber wieso nimmst du den Parameter "-- n" und nicht "-n"?
User avatar
adi99
 
Posts: 115
Joined: 15. January 2004 16:08
Location: Switzerland

Postby Metty_D » 26. August 2005 20:31

adi99 wrote:Bin zwar kein Experte,
aber wieso nimmst du den Parameter "-- n" und nicht "-n"?


tu ich nicht, ich verwende es so wie es oben steht und er meckert mit "apache: illegal option -- n" einfach nur den Parameter an (er kennt ihn angeblich ned) ...
wenn ich statt -n schreibe apache -z dann kommt als Ausgabe apache: illegal option -- z raus
User avatar
Metty_D
 
Posts: 6
Joined: 24. August 2005 15:56

Postby adi99 » 26. August 2005 20:55

was passiert wenn du "apache -n blabla", denn ich denke man muss für name noch was schrieben...

Gruss
User avatar
adi99
 
Posts: 115
Joined: 15. January 2004 16:08
Location: Switzerland

Postby Metty_D » 26. August 2005 21:02

da gibts die gleiche ausgabe wie im Eröffnungspost :(
User avatar
Metty_D
 
Posts: 6
Joined: 24. August 2005 15:56


Return to PHP

Who is online

Users browsing this forum: No registered users and 20 guests