Simone: Exec() Befehl nicht möglich unter WindowsXP, oder doch?

<?/*
Hi
Jetzt habe ich zwei Tage nur Testumgebungen für php und Apache geschaffen
Und das Ergebnis ist gleich null
PHP auf Windows XP und der Befehl Exec() (bzw. das Ausführen von Fremdprogrammen) das verträgt sich nicht
Ich komm einfach nicht weiter. Unter Windows 98 läuft alles super.
Kann den Code unten Jemand mal auf einen XP System testen?

Mein Version:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\windows\system32>

Auch das Überschreiben der httpd bzw. Php.ini mit der lauffähigen Windows 98
Version bringt nichts. (Habe die Config überschrieben)

Simone

*/

exec("C:\windows\system32\notepad.exe");

//oder unten geht auch nicht

$cmd="C:\windows\system32\cmd.exe /notepad.exe";
echo "command: [$cmd]\n";
system($cmd,$value);
echo "Return value is: $value\n";
?>

  1. Hi

    $_SERVER Übersicht

    command: [C:\windows\system32\cmd.exe /notepad.exe] Return value is: 128

    COMSPEC: C:\WINDOWS\system32\cmd.exe
    DOCUMENT_ROOT: c:/programme/apache group/apache/htdocs
    HTTP_ACCEPT: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/msword, */*
    HTTP_ACCEPT_ENCODING: gzip, deflate
    HTTP_ACCEPT_LANGUAGE: de
    HTTP_CONNECTION: Keep-Alive
    HTTP_HOST: localhost
    HTTP_USER_AGENT: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
    PATH: C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programme\Gemeinsame Dateien\Adaptec Shared\System;C:\PROGRA~1\ULTRAE~1
    REMOTE_ADDR: 127.0.0.1
    REMOTE_PORT: 1766
    SCRIPT_FILENAME: c:/programme/apache group/apache/htdocs/opti/adeitemanger/verbin.php
    SERVER_ADDR: 127.0.0.1
    SERVER_ADMIN: info@ortho
    SERVER_NAME: localhost
    SERVER_PORT: 80
    SERVER_SIGNATURE:
    Apache/1.3.20 Server at localhost Port 80

    SERVER_SOFTWARE: Apache/1.3.20 (Win32) PHP/4.2.3
    SystemRoot: C:\WINDOWS
    WINDIR: C:\WINDOWS
    GATEWAY_INTERFACE: CGI/1.1
    SERVER_PROTOCOL: HTTP/1.1
    REQUEST_METHOD: GET
    QUERY_STRING:
    REQUEST_URI: /opti/adeitemanger/verbin.php
    SCRIPT_NAME: /opti/adeitemanger/verbin.php
    PATH_TRANSLATED: c:/programme/apache group/apache/htdocs/opti/adeitemanger/verbin.php
    PHP_SELF: /opti/adeitemanger/verbin.php
    argv: Array
    argc: 0

    Simone

    1. PHP Version 4.2.3

      System Windows NT 5.1 build 2600 Build Date Sep 6 2002 10:38:51 Server API Apache Virtual Directory Support enabled Configuration File (php.ini) Path C:\WINDOWS\php.ini Debug Build no Thread Safety enabled

      This program makes use of the Zend Scripting Language Engine: Zend Engine v1.2.0, Copyright (c) 1998-2002 Zend Technologies


      PHP 4 Credits


      Configuration PHP Core Directive Local Value Master Value allow_call_time_pass_reference  On On allow_url_fopen  1 1 always_populate_raw_post_data  0 0 arg_separator.input  & & arg_separator.output  & & asp_tags  Off Off auto_append_file  no value no value auto_prepend_file  no value no value browscap  no value no value default_charset  no value no value default_mimetype  text/html text/html define_syslog_variables  Off Off disable_functions  no value no value display_errors  On On display_startup_errors  Off Off doc_root  c:\Programme\apache group\apache\htdocs c:\Programme\apache group\apache\htdocs enable_dl  On On error_append_string  no value no value error_log  no value no value error_prepend_string  no value no value error_reporting  2039 2039 expose_php  On On extension_dir  c:\php4\extensions c:\php4\extensions file_uploads  1 1 gpc_order  GPC GPC highlight.bg  #FFFFFF #FFFFFF highlight.comment  #FF9900 #FF9900 highlight.default  #0000CC #0000CC highlight.html  #000000 #000000 highlight.keyword  #006600 #006600 highlight.string  #CC0000 #CC0000 html_errors  On On ignore_user_abort  Off Off implicit_flush  Off Off include_path  .;c:\php4\pear .;c:\php4\pear log_errors  Off Off magic_quotes_gpc  On On magic_quotes_runtime  Off Off magic_quotes_sybase  Off Off max_execution_time  30 30 open_basedir  no value no value output_buffering  no value no value output_handler  no value no value post_max_size  8M 8M precision  12 12 register_argc_argv  On On register_globals  On On safe_mode  Off Off safe_mode_exec_dir  no value no value safe_mode_gid  Off Off safe_mode_include_dir  no value no value sendmail_from  me@localhost.com me@localhost.com sendmail_path  no value no value short_open_tag  On On SMTP  localhost localhost sql.safe_mode  Off Off track_errors  Off Off unserialize_callback_func  no value no value upload_max_filesize  2M 2M upload_tmp_dir  no value no value user_dir  no value no value variables_order  EGPCS EGPCS xmlrpc_error_number  0 0 xmlrpc_errors  Off Off y2k_compliance  Off Off

      standard Regex Library Bundled library enabled Dynamic Library Support enabled Internal Sendmail Support for Windows enabled

      Directive Local Value Master Value assert.active  1 1 assert.bail  0 0 assert.callback  no value no value assert.quiet_eval  0 0 assert.warning  1 1 safe_mode_allowed_env_vars  PHP_ PHP_ safe_mode_protected_env_vars  LD_LIBRARY_PATH LD_LIBRARY_PATH url_rewriter.tags  a=href,area=href,frame=src,input=src,form=fakeentry a=href,area=href,frame=src,input=src,form=fakeentry

      bcmath BCMath support enabled

      calendar Calendar support enabled

      com Directive Local Value Master Value com.allow_dcom  Off Off com.autoregister_casesensitive  On On com.autoregister_typelib  Off Off com.autoregister_verbose  Off Off com.typelib_file  no value no value

      ftp FTP support enabled

      mysql MySQL Support enabled Active Persistent Links 0 Active Links 0 Client API version 3.23.39

      Directive Local Value Master Value mysql.allow_persistent  On On mysql.default_host  no value no value mysql.default_password  no value no value mysql.default_port  no value no value mysql.default_socket  no value no value mysql.default_user  no value no value mysql.max_links  Unlimited Unlimited mysql.max_persistent  Unlimited Unlimited

      odbc ODBC Support enabled Active Persistent Links 0 Active Links 0 ODBC library Win32

      Directive Local Value Master Value odbc.allow_persistent  On On odbc.check_persistent  On On odbc.default_db  no value no value odbc.default_pw  no value no value odbc.default_user  no value no value odbc.defaultbinmode  return as is return as is odbc.defaultlrl  return up to 4096 bytes return up to 4096 bytes odbc.max_links  Unlimited Unlimited odbc.max_persistent  Unlimited Unlimited

      pcre PCRE (Perl Compatible Regular Expressions) Support enabled PCRE Library Version 3.4 22-Aug-2000

      session Session Support enabled

      Directive Local Value Master Value session.auto_start  Off Off session.cache_expire  180 180 session.cache_limiter  nocache nocache session.cookie_domain  no value no value session.cookie_lifetime  0 0 session.cookie_path  / / session.cookie_secure  Off Off session.entropy_file  no value no value session.entropy_length  0 0 session.gc_maxlifetime  1440 1440 session.gc_probability  1 1 session.name  PHPSESSID PHPSESSID session.referer_check  no value no value session.save_handler  files files session.save_path  /tmp /tmp session.serialize_handler  php php session.use_cookies  On On session.use_trans_sid  0 0

      xml XML Support active XML Namespace Support active EXPAT Version 1.95.2

      wddx WDDX Support enabled

      gd GD Support enabled GD Version 1.6.2 or higher FreeType Support enabled FreeType Linkage with TTF library JPG Support enabled PNG Support enabled WBMP Support enabled

      apache Apache for Windows 95/NT

      Apache Version Apache/1.3.24 Apache Release 10324100 Apache API Version 19990320 Hostname:Port localhost:80 Timeouts Connection: 300 - Keep-Alive: 15

      Directive Local Value Master Value child_terminate  0 0 engine  1 1 last_modified  0 0 xbithack  0 0

      Apache Environment Variable Value COMSPEC C:\WINDOWS\system32\cmd.exe DOCUMENT_ROOT c:/programme/apache group/apache/htdocs HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/msword, / HTTP_ACCEPT_ENCODING gzip, deflate HTTP_ACCEPT_LANGUAGE de HTTP_CONNECTION Keep-Alive HTTP_HOST localhost HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) PATH C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programme\Gemeinsame Dateien\Adaptec Shared\System;C:\PROGRA~1\ULTRAE~1 REMOTE_ADDR 127.0.0.1 REMOTE_PORT 1822 SCRIPT_FILENAME c:/programme/apache group/apache/htdocs/opti/adeitemanger/verbin.php SERVER_ADDR 127.0.0.1 SERVER_ADMIN info@ortho SERVER_NAME localhost SERVER_PORT 80 SERVER_SIGNATURE <ADDRESS>Apache/1.3.20 Server at localhost Port 80</ADDRESS>

      SERVER_SOFTWARE Apache/1.3.20 (Win32) PHP/4.2.3 SystemRoot C:\WINDOWS WINDIR C:\WINDOWS GATEWAY_INTERFACE CGI/1.1 SERVER_PROTOCOL HTTP/1.1 REQUEST_METHOD GET QUERY_STRING REQUEST_URI /opti/adeitemanger/verbin.php SCRIPT_NAME /opti/adeitemanger/verbin.php

      HTTP Headers Information HTTP Request Headers HTTP Request GET /opti/adeitemanger/verbin.php HTTP/1.1 Accept image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/msword, / Accept-Encoding gzip, deflate Accept-Language de Connection Keep-Alive Host localhost User-Agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) HTTP Response Headers X-Powered-By PHP/4.2.3 Keep-Alive timeout=15, max=100 Connection Keep-Alive Transfer-Encoding chunked Content-Type text/html

      Additional Modules

      Environment Variable Value ALLUSERSPROFILE C:\Dokumente und Einstellungen\All Users CommonProgramFiles C:\Programme\Gemeinsame Dateien COMPUTERNAME HOME ComSpec C:\WINDOWS\system32\cmd.exe NUMBER_OF_PROCESSORS 1 OS Windows_NT Path C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programme\Gemeinsame Dateien\Adaptec Shared\System;C:\PROGRA~1\ULTRAE~1 PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH PROCESSOR_ARCHITECTURE x86 PROCESSOR_IDENTIFIER x86 Family 6 Model 6 Stepping 2, AuthenticAMD PROCESSOR_LEVEL 6 PROCESSOR_REVISION 0602 ProgramFiles C:\Programme SystemDrive C: SystemRoot C:\WINDOWS TEMP C:\WINDOWS\TEMP TMP C:\WINDOWS\TEMP USERPROFILE C:\Dokumente und Einstellungen\LocalService windir C:\WINDOWS

      PHP Variables Variable Value PHP_SELF /opti/adeitemanger/verbin.php _SERVER["COMSPEC"] C:\WINDOWS\system32\cmd.exe _SERVER["DOCUMENT_ROOT"] c:/programme/apache group/apache/htdocs _SERVER["HTTP_ACCEPT"] image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/msword, / _SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate _SERVER["HTTP_ACCEPT_LANGUAGE"] de _SERVER["HTTP_CONNECTION"] Keep-Alive _SERVER["HTTP_HOST"] localhost _SERVER["HTTP_USER_AGENT"] Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) _SERVER["PATH"] C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programme\Gemeinsame Dateien\Adaptec Shared\System;C:\PROGRA~1\ULTRAE~1 _SERVER["REMOTE_ADDR"] 127.0.0.1 _SERVER["REMOTE_PORT"] 1822 _SERVER["SCRIPT_FILENAME"] c:/programme/apache group/apache/htdocs/opti/adeitemanger/verbin.php _SERVER["SERVER_ADDR"] 127.0.0.1 _SERVER["SERVER_ADMIN"] info@ortho _SERVER["SERVER_NAME"] localhost _SERVER["SERVER_PORT"] 80 _SERVER["SERVER_SIGNATURE"] <ADDRESS>Apache/1.3.20 Server at localhost Port 80</ADDRESS>

      _SERVER["SERVER_SOFTWARE"] Apache/1.3.20 (Win32) PHP/4.2.3 _SERVER["SystemRoot"] C:\WINDOWS _SERVER["WINDIR"] C:\WINDOWS _SERVER["GATEWAY_INTERFACE"] CGI/1.1 _SERVER["SERVER_PROTOCOL"] HTTP/1.1 _SERVER["REQUEST_METHOD"] GET _SERVER["QUERY_STRING"] _SERVER["REQUEST_URI"] /opti/adeitemanger/verbin.php _SERVER["SCRIPT_NAME"] /opti/adeitemanger/verbin.php _SERVER["PATH_TRANSLATED"] c:/programme/apache group/apache/htdocs/opti/adeitemanger/verbin.php _SERVER["PHP_SELF"] /opti/adeitemanger/verbin.php _SERVER["argv"] Array ( )

      _SERVER["argc"] 0 _ENV["ALLUSERSPROFILE"] C:\Dokumente und Einstellungen\All Users _ENV["CommonProgramFiles"] C:\Programme\Gemeinsame Dateien _ENV["COMPUTERNAME"] HOME _ENV["ComSpec"] C:\WINDOWS\system32\cmd.exe _ENV["NUMBER_OF_PROCESSORS"] 1 _ENV["OS"] Windows_NT _ENV["Path"] C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programme\Gemeinsame Dateien\Adaptec Shared\System;C:\PROGRA~1\ULTRAE~1 _ENV["PATHEXT"] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH _ENV["PROCESSOR_ARCHITECTURE"] x86 _ENV["PROCESSOR_IDENTIFIER"] x86 Family 6 Model 6 Stepping 2, AuthenticAMD _ENV["PROCESSOR_LEVEL"] 6 _ENV["PROCESSOR_REVISION"] 0602 _ENV["ProgramFiles"] C:\Programme _ENV["SystemDrive"] C: _ENV["SystemRoot"] C:\WINDOWS _ENV["TEMP"] C:\WINDOWS\TEMP _ENV["TMP"] C:\WINDOWS\TEMP _ENV["USERPROFILE"] C:\Dokumente und Einstellungen\LocalService _ENV["windir"] C:\WINDOWS

      1. Hi

        Auszug:

        <Directory "C:/Programme/Apache Group/Apache/htdocs">

        This may also be "None", "All", or any combination of "Indexes",

        "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".

        Note that "MultiViews" must be named *explicitly* --- "Options All"

        doesn't give it to you.

        Options Indexes FollowSymLinks MultiViews
                Options Includes ExecCGI
                   Options Includes All

        This controls which options the .htaccess files in directories can

        override. Can also be "All", or any combination of "Options", "FileInfo",

        "AuthConfig", and "Limit"

        AllowOverride None

        Controls who can get stuff from this server.

        Order allow,deny
            Allow from all
        </Directory>

        Simone

        1. Moin Moin !

          Hast Du das Forum jetzt genug zugemüllt ?

          Alexander

          --
          Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so!"
          1. HI

            Der Sinn eines Forums???

            Hast Du das Forum jetzt genug zugemüllt ?

            Das was für Dich Müll ist, kann für mich und Andere ein Problem sein.

            Von allen hier Teilnehmenden werden HTML-Grundkenntnisse erwartet. Es wird erwartet, daß bei PROBLEME erst einmal in SELFHTML, im  Forumsarchiv oder in anderen Quellen nach einer Lösung gesucht wird.

            Und das hab ich durchsucht und noch viel mehr..........

            Kann Jemand mal was "Sinnvolles" zu mein Prob. schreiben

            Danke Simone

  2. <?/*
    Hi
    Jetzt habe ich zwei Tage nur Testumgebungen für php und Apache geschaffen
    Und das Ergebnis ist gleich null

    Nur ein kleiner Tipp, der nicht unbedingt funktionieren muss: Versuche mal in XP die cmd.exe ohne Pfadangabe aufzurufen.
    Der Pfad dürfte dem System - anders als bei 98 - nämlich schon bekannt sein.

    CU

    1. Hi
      Das ist es nicht;

      Aber Danke

      Simone