masumrana / phpdesktop

Automatically exported from code.google.com/p/phpdesktop
0 stars 0 forks source link

Missing CGI environment variables: WINDIR and others #136

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
May the missing WINDIR env variable be the cause of sql server extension 
failing to load sqlserv32.dll during connect? (see error message in Issue 135).

Expose these environment variables:

 _ENV["ALLUSERSPROFILE"] => C:\ProgramData
 _ENV["APPDATA"] => C:\Users\ctomczak\AppData\Roaming
 _ENV["COMPUTERNAME"] => CTOMCZAK-PC
 _ENV["LOCALAPPDATA"] => C:\Users\ctomczak\AppData\Local
 _ENV["OS"] => Windows_NT
 _ENV["PROCESSOR_ARCHITECTURE"] => x86
 _ENV["PROCESSOR_ARCHITEW6432"] => AMD64
 _ENV["PROCESSOR_IDENTIFIER"] => Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
 _ENV["ProgramData"] => C:\ProgramData
 _ENV["ProgramW6432"] => C:\Program Files
 _ENV["PUBLIC"] => C:\Users\Public
 _ENV["USERNAME"] => ctomczak
 _ENV["USERPROFILE"] => C:\Users\ctomczak

 _ENV["windir"] => C:\Windows (php.exe -i shows this env var in lowercase. Why not uppercase WINDIR, does it make difference?)

 _ENV["ComSpec"] => C:\Windows\system32\cmd.exe (note that there is "COMSPEC" exposed by Mongoose but it is uppercase, does it make difference?)

 _ENV["SystemRoot"] => C:\Windows (note that Mongoose exposes "SYSTEMROOT", does uppercase make difference?)

Is there an easy way to obtain all environment variables exposed by OS using 
WINAPI? See `GetEnvironmentStrings` on MSDN: 
http://msdn.microsoft.com/en-us/library/windows/desktop/ms683187(v=vs.85).aspx

Original issue reported on code.google.com by czarek.t...@gmail.com on 21 Oct 2014 at 9:18

GoogleCodeExporter commented 8 years ago
Regarding problem with loading %windir%/system32/sqlsrv32.dll - this has 
probably nothing to do with %windir% env variable not being exposed. In this 
post Dallin explains he got SQL Server working fine with PHP Desktop after 
downloading a correct version of DLL, see:
https://groups.google.com/d/msg/phpdesktop/GNOcA93gN1k/1y2_WI4iYLQJ

Original comment by czarek.t...@gmail.com on 21 Oct 2014 at 9:30

GoogleCodeExporter commented 8 years ago
when you place the file under www/%windir%/system32/ the file is found but 
couldnt load because it only laods in C:/windows/system32 folder

Original comment by benschh...@gmail.com on 21 Oct 2014 at 9:38

GoogleCodeExporter commented 8 years ago
@#2 benschhold: To confirm that the missing WINDIR envrionment variable is 
causing the issue, try setting that env var using command line flag and see if 
that solves the problem. See: 
https://code.google.com/p/phpdesktop/wiki/CGIEnvironmentFromArgs .

Original comment by czarek.t...@gmail.com on 21 Oct 2014 at 9:50

GoogleCodeExporter commented 8 years ago
i am not shure if i did what you said but i did set verbindung=%windir% and the 
result was:
[VERBINDUNG_] =>  C:\Windows

so windir should be working right?

Original comment by benschh...@gmail.com on 21 Oct 2014 at 10:21

GoogleCodeExporter commented 8 years ago

Original comment by czarek.t...@gmail.com on 21 Oct 2014 at 10:29

GoogleCodeExporter commented 8 years ago
%ComSpec% and %SystemRoot% should be in camel case, and %windir% should be in 
lowercase, according to https://en.wikipedia.org/wiki/Environment_variable . 
See also: 
http://msdn.microsoft.com/en-us/library/windows/desktop/dd378457(v=vs.85).aspx .

Fixed in revision d2b1fb29f7da. phpdesktop chrome 31.8 / msie 1.14 executables 
were updated on dropbox. Lots of new environment variables have been exposed:

    [APPDATA] => C:\Users\ctomczak\AppData\Roaming
    [LOCALAPPDATA] => C:\Users\ctomczak\AppData\Local
    [ComSpec] => C:\Windows\system32\cmd.exe
    [OS] => Windows_NT
    [ProgramFiles] => C:\Program Files (x86)
    [ProgramFiles(x86)] => C:\Program Files (x86)
    [ProgramW6432] => C:\Program Files
    [CommonProgramFiles] => C:\Program Files (x86)\Common Files
    [CommonProgramFiles(x86)] => C:\Program Files (x86)\Common Files
    [CommonProgramW6432] => C:\Program Files\Common Files
    [SystemDrive] => C:
    [SystemRoot] => C:\Windows
    [windir] => C:\Windows
    [ALLUSERSPROFILE] => C:\ProgramData
    [ProgramData] => C:\ProgramData
    [PUBLIC] => C:\Users\Public
    [USERDOMAIN] => ctomczak-PC
    [USERPROFILE] => C:\Users\ctomczak
    [HOMEPATH] => \Users\ctomczak
    [HOMEDRIVE] => C:
    [COMPUTERNAME] => CTOMCZAK-PC
    [LOGONSERVER] => \\CTOMCZAK-PC
    [PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    [PSModulePath] => C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
    [USERNAME] => ctomczak

Original comment by czarek.t...@gmail.com on 30 Oct 2014 at 9:47

GoogleCodeExporter commented 8 years ago
Project will move to Github. Find this issue at the new address (soon): 
https://github.com/cztomczak/phpdesktop/issues/136

Original comment by czarek.t...@gmail.com on 24 Aug 2015 at 3:32